无密码 SSH 访问无法处理被拒绝的消息

无密码 SSH 访问无法处理被拒绝的消息

我在两台 Linux 主机之间设置了 SSH 无密码访问。但无密码访问不起作用。身份验证被取消,并显示拒绝消息,如下所示

  su - wsync
 -bash-4.1$ ssh node-x3
  debug1: Authentication succeeded (publickey).
  debug1: channel 0: new [client-session]
  debug1: Requesting [email protected]
 debug1: Entering interactive session.
 debug1: Sending environment.
 debug1: Sending env LANG = en_US.UTF-8
 debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
 debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
 Rejected
 debug1: channel 0: free: client-session, nchannels 1
 Connection to node-x3 closed.
 Transferred: sent 2760, received 3504 bytes, in 0.5 seconds
 Bytes per second: sent 5997.7, received 7614.5
 debug1: Exit status 0

/var/log/secure在目标主机上可以看到以下内容

Jul  1 18:49:23 syd-fs-x3 sshd[17261]: pam_unix(sshd:session): session opened for user wsync by (uid=0)
Jul  1 18:49:23 syd-fs-x3 sshd[17266]: error: open /dev/tty failed - could not set controlling tty: Permission denied
Jul  1 18:49:24 syd-fs-x3 sshd[17265]: Received disconnect from 10.200.X.X: 11: disconnected by user
Jul  1 18:49:24 syd-fs-x3 sshd[17261]: pam_unix(sshd:session): session closed for user wsync

wsync用户在目标主机上处于 chroot 状态

-bash-4.1$ pwd
/home/chroot/home/wsync

 $ ls -l /home/chroot/dev/tty
 crw-rw-rw- 1 root root 5, 0 Nov 30  2015 /home/chroot/dev/tty

wsync以下是目标主机上用户的设置。

     $ sudo grep -A 2 wsync /etc/ssh/sshd_config
      Match User wsync
      ChrootDirectory /home/chroot
      ForceCommand /home/bin/validate-rsync.sh

/etc/securetty按要求输出

$ sudo grep tty /etc/securetty
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11

请让我知道是什么问题?

相关内容