Equivalent of /etc/hosts File for Individual Users
I really like the ability to set up aliases in an /etc/hosts file. However, I’ve always wanted the same functionality when logged in as a regular user. (One can only edit the /etc/hosts file if root or with sudo permissions.)
Through a little research, I found it’s possible. Here are the steps:
vi ~/.ssh/config
Add:
Host myalias
Hostname my.real.hostname
User myusername
Save and close (shift + ZZ)
Set the permissions:
chmod 600 ~/.ssh/config
Test it:
ssh myalias
Written by Gor
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Configuration
Authors
danielpuglisi
17.34K
fsproru
13.19K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#