不能使用密码只能使用密钥远程登录设置:

打开sshd配置文件  
vim  /etc/ssh/sshd_config  在最后面增加一行 :
  1. PermitRootLogin without-password

  2. 最后重启ssh 服务    service sshd restart

  3. 然后在root的目录下建立.ssh这个目录,把生成的公钥放到authorized_keys这个文件里,(需要自己创建)

  4. 在ssh远程软件上面设置用密钥登录即可。




不允许远程登录的设置

vim /etc/ssh/sshd_config  加入一行:

  1. PermitRootLogin no

    保存退出,重启服务

    service sshd restart