配置SSH Key
小于 1 分钟约 193 字
配置SSH KEY
如果存在 id_rsa 和 id_rsa.pub文件,说明已经有SSH Key

查看id_rsa.pub中的内容

如果不存在,可以先用 如下命令生成
ssh-keygen -t rsa -C [youremail@example.com](mailto:youremail@example.com)
测试链接

免密登录服务器
可以满足A机器免密登录到B机器:
1、登录A机器
2、如果有就不要生成了,否则ssh-keygen -t [rsa|dsa]
,(rsa和dsa选一种加密算法),将会生成密钥文件和私钥文件 id_rsa,id_rsa.pub或id_dsa,id_dsa.pub
3、将 .pub 文件复制到B机器的 .ssh 目录, 并 cat id_rsa.pub >> ~/.ssh/authorized_keys
4、此时A登录B不需要密码ssh root@ip -p 22