IP alias? Machine name alias?
I'm sure this is a fairly simple question and answer, but I don't even know the right words to ask it. I've got two computers that aren't on the same network which I log in to remotely (using ssh). I know I can make an alias, but I'm wondering if there's a more "correct" way to tell the computer that "Lenny" is at 6.16.xxx.xxx and "Bugz" is at 168.2.xxx.xxx.
Is there something like an /etc/machine file where I can set that information so later I can just type "ssh Lenny" or "sftp Bugz" and get to the right box? Thanks ... and if you could tell me the correct way of /describing/ this problem, I'd be happy to look at a manual already out there somewhere. |
The file /etc/hosts is used for that put the machine address then name on a line by themselves then you can use them in the command an example of the file.
Code:
6.16.xxx.xxx Lenny |
Quote:
edit : ok happytux was faster ;) |
Grrr ... I probably should have known that.
Anyway ... thanks much for the answer! That works brilliantly. |
You can also add them to your ssh file (/etc/ssh/ssh_config in RH distros) like this:
Code:
host fileserver Code:
ssh fileserver |
All times are GMT -5. The time now is 08:16 PM. |