当我使用sshpass登陆到其他主机时,会报错“root@IP's password:  Permission denied, please try again.”


  1. root密码无误。

  2. iptables关闭。

  3. sshd服务开启。


这时需要修改配置文件/etc/ssh/sshd_config的几个参数。

PasswordAuthentication yes

PermitRootLogin yes

UsePrivilegeSeparation no


重启sshd服务:

#/etc/init.d/sshd restart