CentOS7.6 SSH证书登录
CentOS7.6 使用ssh证书登录
生成证书并重命名
ssh-keygen -t rsa -b 4096 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
对证书加权限
chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys
将证书回传至本地
yum install -y lrzsz cd /root/.ssh sz id_rsa
SecureCRT回传默认保存在C:\Users\Administrator\Downloads
修改ssh服务端配置
vim /etc/ssh/sshd_config 修改 Port 2222 PermitRootLogin yes StrictModes no PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys PermitEmptyPasswords no PasswordAuthentication no
注意:CentOS7.4已废除#RSAAuthentication字段
重启服务生效
systemctl restart sshd.service
SecureCRT设置
然后再输入生成证书时的phrase
本站所有文章均可随意转载,转载时请保留原文链接及作者。