如何为用户管理员启用 ssh?
我在 sshd_config 中使用了这个:
AllowUsers 管理员
重新启动 ssh 后,我尝试登录,输入用户名 + pw,但没有得到任何答案。怎么了?
也许是这个设置的原因?
Match group filetransfer
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
答案1
我使用此 sshd_config 允许 root 和 sshlogin 中的用户通过 ssh 登录。netlogin 组中的用户被 chrooted:
# 2009-04-27
AllowGroups root netlogin sshlogin
PermitRootLogin without-password
PermitEmptyPasswords no
PubkeyAuthentication yes
UsePAM yes
ChallengeResponseAuthentication no
PasswordAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
#AcceptEnv LANG LC_*
AddressFamily inet
HostbasedAuthentication no
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_rsa_key
IgnoreRhosts yes
MaxStartups 4
KeyRegenerationInterval 3600
LoginGraceTime 60
LogLevel INFO
PrintLastLog yes
PrintMotd no
Protocol 2
Port 22
RhostsRSAAuthentication no
RSAAuthentication yes
ServerKeyBits 768
StrictModes yes
SyslogFacility AUTH
TCPKeepAlive yes
UsePrivilegeSeparation yes
X11DisplayOffset 10
X11Forwarding no
Subsystem sftp internal-sftp
Match group netlogin
ChrootDirectory /home
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp