Centos7 PuTTY密匙登录
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos7 PuTTY密匙登录相关的知识,希望对你有一定的参考价值。
1:root执行ssh-keygen -t rsa 全部回车 生成id_rsa, id_rsa.pub文件,第一个是私钥 第二个是公钥
2:chmod 600 /root/.ssh/ 设置600权限,防止写入
3:cat id_ras.pub >> authorized_keys id_rsa.pub附加到 authorized_keys 这个档案
公钥登录 vi /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
重启:systemctl restart sshd.service
如果禁用密码登录修改:PasswordAuthentication no
4:如果putty Server refused our key 报错
vi /etc/selinux/config 修改 SELINUX=disabled
设备互访,拷贝公匙
1:ssh-keygen -t rsa
2:ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
3:ssh ip
以上是关于Centos7 PuTTY密匙登录的主要内容,如果未能解决你的问题,请参考以下文章
CentOS7.4在digitalocean上为新建用户利用Putty使用免密登录
CentOS7与Windows AD集成之二Windows域账户登录CentOS7