using alias instead of IP in scp
shell, unix
Solution
One way to deal with this is to create an entry in your ssh configuration. This can be done on a system wide basis or, if you don't have root access on this box, just for your user.
The per user configuration file is `~/.ssh/config` and uses the following format
host my_desktop
hostname 11.22.33.44
This method is also nice because you can specify other options like the user name. To find out more about the options available try `man ssh_config`.
Problem
I have a desktop in the office that I often need to access from home and use scp to copy files. Currently I am doing it like this ``` scp username@x.x.x.x ... ``` I want a mechanism that I dont have to type the IP address each time I want to scp something. I was trying to do it by creating an alias, but it doesn't seem to work. Can I give my desktop machine a name so that instead of typing the ip address I can use the name of the machine instead ?