我创build了一个没有shell访问权限的新用户:
useradd -g www -d /www/user01 -p ****** -s /sbin/nologin user01
然后在我的sshd_config添加这些行:
AllowUsers user01 user02 manager Subsystem sftp internal-sftp Match User user01 ChrootDirectory /www/user01 PasswordAuthentication yes ForceCommand internal-sftp
问题是我得到拒绝每次我用腻子login,是否有任何错误configuration?
更新:
看来,唯一的用户可以ssh是root用户,甚至添加新的用户到AllowUsers指令。
/sbin/nologin是你的问题。
你有两个选项: /bin/bash和/bin/bash (chrooted)。
基本上,chrooted bash是为了避免事故。