【Linux】Xshell 配置密钥登陆

设置不需要密码登陆

vim /etc/ssh/sshd_config

在配置文件中参数的意义

 PubkeyAuthentication yes    #启用公告密钥配对认证方式 
 AuthorizedKeysFile  %h/.ssh/authorized_keys    #设定PublicKey文件路径
 RSAAuthentication yes  #允许RSA密钥
 PasswordAuthentication no #禁止密码验证登录,如果启用的话,RSA认证登录就没有意义了
 #禁用root账户登录,非必要,但为了安全性,请配置
 PermitRootLogin no

如果需要密码就可以ssh登陆的话,将PasswordAuthentication  设置为yes

然后重启ssh 服务 进入到  /etc/init.d 文件夹内 执行 ./ssh restart

猜你喜欢

转载自www.cnblogs.com/simple-flw/p/12927542.html
今日推荐