1.ssh-keygen
用于生成密钥,操作时一路回车
2.打开配置文件 ,修改使用密钥登录
vim /etc/ssh/ssh_config
写入:PubkeyAuthentication yes
关闭密码登录:PasswordAuthentication no
3.把公钥追加到authorized_keys里
cd :/root/.ssh
cat id_rsa.pub >> authorized_keys
4.sz id_rsa 到本机(桌面上用于登录时用)
1.ssh-keygen
用于生成密钥,操作时一路回车
2.打开配置文件 ,修改使用密钥登录
vim /etc/ssh/ssh_config
写入:PubkeyAuthentication yes
关闭密码登录:PasswordAuthentication no
3.把公钥追加到authorized_keys里
cd :/root/.ssh
cat id_rsa.pub >> authorized_keys
4.sz id_rsa 到本机(桌面上用于登录时用)