生成公钥和私钥
ssh-keygen -t rsa
实现无秘登录
ssh-copy-id ip/域名
例如 ssh-copy-id ubuntu200 我在/etc/hosts文件绑定了ip
如果要取别名
修改家目录下修改.ssh/config文件
vim ./ssh/config
加入如下格式的代码
Host ubuntu200 #服务器别名
HostName 192.168.1.200 #服务器地址
User root #服务器用户
ssh-keygen -t rsa
ssh-copy-id ip/域名
例如 ssh-copy-id ubuntu200 我在/etc/hosts文件绑定了ip
修改家目录下修改.ssh/config文件
vim ./ssh/config
加入如下格式的代码
Host ubuntu200 #服务器别名
HostName 192.168.1.200 #服务器地址
User root #服务器用户