使用协议 2 密码和 OpenSSH 7.1 服务器时出现“糟糕的 SSH2 密码规范”

使用协议 2 密码和 OpenSSH 7.1 服务器时出现“糟糕的 SSH2 密码规范”

我正在尝试确定 OpenSSH 7.1 服务器认为哪些密码是违规的。OpenSSH 7.1 服务器使用 OpenSSL 1.0.2d 构建

下面,我添加了换行符以便于阅读,但行中没有空格或换行符(除了之后Ciphers):

$ sudo /usr/local/sbin/sshd -t -f /usr/local/etc/sshd_config
/usr/local/etc/sshd_config line 28: Bad SSH2 cipher spec '[email protected],\
[email protected],[email protected],aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,\
aes192-cbc,aes256-cbc'.

OpenSSH 7.1 服务器认为哪些密码具有攻击性?


下面的大部分注释行已被删除sshd_config

$ cat /usr/local/etc/sshd_config
#   $OpenBSD: sshd_config,v 1.97 2015/08/06 14:53:21 deraadt Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.
...

# The default requires explicit activation of protocol 1
Protocol 2

# HostKeys for protocol version 2
HostKey /usr/local/etc/ssh_host_ed25519_key
HostKey /usr/local/etc/ssh_host_ecdsa_key
HostKey /usr/local/etc/ssh_host_dsa_key
HostKey /usr/local/etc/ssh_host_rsa_key

# Ciphers and keying
# Ciphers [email protected],[email protected],[email protected],aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc

RekeyLimit 1G 4h

# Authentication:

LoginGraceTime 2m

KbdInteractiveAuthentication yes
PubkeyAuthentication yes
PasswordAuthentication no
ChallengeResponseAuthentication no

# Check only .ssh/authorized_keys
AuthorizedKeysFile  .ssh/authorized_keys

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing.
#UsePAM no

# Use Apple's sandbox. On later versions of OS X, the sandbox is a stand alone
#   library and requires config'ing with --with-libs="-lsandbox"
UsePrivilegeSeparation sandbox

# override default of no subsystems
Subsystem   sftp    /usr/local/libexec/sftp-server

答案1

您输入了[email protected],应该是[email protected]

基本上,你可以通过将列表划分为密码并使用 sshd 尝试每个密码来轻松找到答案:

echo '[email protected],[email protected],[email protected],aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc' | sed -e "s/,/ /g"
for c in [email protected] [email protected] [email protected] aes128-ctr aes192-ctr aes256-ctr aes128-cbc aes192-cbc aes256-cbc; do
  sshd -t -o Ciphers=$c
done

相关内容