SSH的快捷方式
by Elton on 六.16, 2009, under Linux
平常我们在使用ssh的时候,经常需要以
1 | ssh [user]@[remote.server.com] |
这样的形式来登录远程主机,每次输入用户名和主机的ip地址很麻烦。 后来发现可以在~/.ssh/config中进行配置
1 2 3 | Host [the alias] HostName [domain name or IP address] User [the account to login as] |
这样以后就可以使用alias这个昵称来登录。例如原来你使用ssh root@172.1.1.200来登录,你起了一个test的昵称,之后你就可以使用
1 | ssh test |
来登录了。 甚至scp都可以,如:
1 | scp sometext.txt test |
是不是较原来方便了很多。


