ssh-keygen -b 4096 -t rsa
生成的私钥保存在 .ssh/id_rsa , 公钥在.ssh/id_rsa.pub
编辑/etc/ssh/sshd_config文件, 确保以下参数
RSAAuthentication yes
PubkeyAuthentication yes
本地客户端输入
ssh-copy-id user@host
就可以将公钥上传到远程服务器的.ssh/authorized_keys
这个时候使用ssh user@host就可以不用输入密码直接登录远程服务器了。
更多:
Setup SSH Keys to Login Linux Without Password
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。