Xshell生成密钥对的方式登录linux主机,xshelllinux


生成密钥对

ssh-keygen -t rsa

会在用户家目录.ssh/下生成密钥对

id_rsa

id_rsa.pub

将id_rsa发到客户端,id_rsa.pub改名为authorized_keys(注意是id_rsa.pub,两个不能互换)

ssh 配置文件的位置在 /etc/ssh/sshd_config:

PubkeyAuthentication yes

PermitRootLogin no
SyslogFacility AUTHPRIV
#PasswordAuthentication yes
PasswordAuthentication yes

相关内容