24
May
How Do I Add Entries To A Linux Hosts File When I Don’t Have Root? “hosts” File If I Do Not Have Root Access?
Author: admin // Category: LinuxI want to use an alias for a hostname I log into often. But, I can’t edit the hosts file b/c it’s not my machine and I don’t have root. I can’t seem to find the answer on the web, but I’m sure it must be possible.
What can I do?
Tags: Dont, Entries, File, Have, Hosts, Linux, Root "hosts", When
May 24th, 2009 at 6:06 pm
if you log in to that computer using console, you could just create a short shell script in your home directory. You could name the script with a short name, like ’sshme’
The sshme file would contain these two lines:
#!/bin/bash
ssh myaccount@longhostnamethatyouhatetyping
After you save it, be sure to do:
chmod +x sshme
Then you can execute it by typing
./sshme