大网数据广告活动
服务器运维问答

How to enable ssh access without public/private keys?

· 52CE 我爱测

I am building a progressive cyber challenge for my club members (the challenges work), but what I was trying to do to make the progressive part is have each challenge reveal the password for the next account (kind of like the ban…

问题原文

原帖链接 · AJ Henley · CC BY-SA 4.0

I am building a progressive cyber challenge for my club members (the challenges work), but what I was trying to do to make the progressive part is have each challenge reveal the password for the next account (kind of like the bandit challenge on overthewire.org).

So I am creating 18 accounts on the boxes, each with a different password and the password for user7 is hidden in the home directory of user6 and you have to pass the challenge to get it.

Anyway, everything works locally, but I can't seem to enable password-only ssh for these non-root accounts. There are tons of quides about getting publickey ssh working, but everything seems to treat password ssh like it just works automatically, but it keeps telling me that my password is invalid even though it isn't. Anyone know of a good guide for this?

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

社区高分解答

原帖链接 · frontsidebus · CC BY-SA 4.0

You need to add

PasswordAuthentication yes

to your config file in

/etc/ssh/sshd_config

Once you have that added, you'll need to reload your SSH daemon, using sudo systemctl restart ssh or similar as appropriate for your platform.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-07-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。