ssh别名登录远程主机

 

####     本地机器上的.ssh下创建config

 

Host ali

HostName www.xtayjgdufvf.com

Port 22

User root

IdentityFile  ~/.ssh/id_rsa

IdentitiesOnly yes

 

####     远程主机上创建文件,包含本地的公钥

 

root@iZuf6id7ajv83h487fZ:~/.ssh# ls
authorized_keys
root@iZuv83h4otql87fZ:~/.ssh# cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABeA8KEsRgXKSb1R/MaYSjZlZZArVKlcv+apMKMpKssLtGz2bz9BPtbtZ7FlWdJSJw2UR+vmlkP5GdgfxowtTML9siaSTF8MMhljWEM1FYLI1UHrIwfUKwYLaiLW33rIbzzRpBC89+otbiQamKHKg5Lm45X2FFtJbp9xp44IuOoS8aTt+cww4e4D5kFmR6EupA29tk/0C4eYZlxXVemKQqmosClhiucI89WYCw2mbWD8ht8WFE1MaIcCC5jI6+1cY3jOQ/nhVPayxVTVo4x9DLOO9fjacBCPTfEWLcTcTaZ root@fucker

 

posted @ 2018-01-26 09:58  人到中年万事休  阅读(148)  评论(0编辑  收藏  举报