ssh-keygen -t rsa # 生成密钥对,rsa秘钥。
回车,默认路径存储秘钥
回车,无密码
~/.ssh/id_rsa.pub # 公共秘钥
~/.ssh/id_rsa # 私有秘钥
scp ~/.ssh/id_rsa.pub remote:/home/test/.ssh/authorized_keys
远程连接无密码输入失败,查看远程机器 /var/log/secure 。
chmod 700 ~./.ssh # 远程机器
chmod 644 ~./.ssh/id_rsa.pub
chmod 644 ~./.ssh/authorized_keys
无密码ssh访问
最新推荐文章于 2024-06-12 08:30:00 发布