我正在为我的俱乐部成员建立一个渐进的网络挑战(挑战起作用),但我想要做的是让每个挑战都显示下一个账户的密码(有点像overthewire.org上的强盗挑战)。
因此,我在盒子上创建了18个帐户,每个帐户都有不同的密码,user7的密码隐藏在user6的主目录中,您必须通过挑战才能得到它。
无论如何,一切都在本地工作,但我似乎不能为这些非根帐户启用只密码ssh。要让公共密钥ssh正常工作,有很多问题,但是一切似乎都像密码ssh自动工作一样,但它总是告诉我,我的密码是无效的,即使它不是。有人知道这方面的一个好指南吗?
Ubuntu 18.04
/etc/ssh/sshd_config
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no发布于 2018-07-06 20:50:23
你需要添加
PasswordAuthentication yes中的配置文件。
/etc/ssh/sshd_config一旦添加了这个命令,您将需要重新加载SSH守护进程,使用sudo systemctl restart ssh或类似的方法,以适合您的平台。
发布于 2018-08-14 12:16:33
您可能缺少AuthenticationMethods设置。
此外,我还建议使用匹配指令将这些设置限制在特定的用户帐户上。
此配置片段启用特定用户foobar的密码身份验证,而其余配置代码则使用公开密钥身份验证:
Match User foobar
PasswordAuthentication yes
AuthenticationMethods passwordhttps://serverfault.com/questions/919853
复制相似问题