Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm logged into a Linux box but I do not have root access to update the /etc/hosts file. I am connecting to a remote server via its IP address but I would like to connect via hostname instead.

Is it possible for me to configure something in my local session, so that every time I log in it will add my IP address to hostname mapping without being able to access /etc/hosts?

share|improve this question
up vote 0 down vote accepted

The hostname should resolve as it normally does, the only reason you might want to use the hosts file is if you want to change it to something shorter, like instead of ssh user@ OR ssh, you could change it to ssh user@goog by adding goog in your hosts file.

What you could do is set up an alias for any of these connections if you're doing it through a terminal. for bash, it'd be in your .bashrc or .bash_profile in your home directory (~/.bashrc)

share|improve this answer
e.g. export fooserver = in your shell's login script. Then ssh $fooserver or sftp $fooserver etc. – RedGrittyBrick Nov 3 '11 at 15:51
I personally added things like this: alias sshandy='ssh user@{andy's server} -i ~/.ssh/andykey' and when I need to connect to andy's server, I just do sshandy – Rob Nov 3 '11 at 16:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.