centos6 配置ssh密钥登陆

in linux with 0 comment

1.编辑ssh配置

vim /etc/ssh/sshd_config

PasswordAuthentication no           ##yes 改为no,禁止密码登陆

PubkeyAuthentication yes         ##去掉注释,开启此选项
AuthorizedKeysFile      .ssh/authorized_keys          #同上

2.重启sshd服务

service sshd restart

3.生成密钥

ssh-keygen -t rsa
cd .ssh/
cat id_rsa.pub >> authorized_keys    ##写入公钥
sz id_rsa     ##down下私钥到本地

4.配置secureCRT密钥登陆

1.jpg

2.png

Responses