我尝试按照此处的说明进行操作:http : //lani78.wordpress.com/2008/08/08/generate-a-ssh-key-and-disable-password-authentication-on-ubuntu-server/
只允许在服务器上使用公钥的用户进行身份验证,但我无法让 SSH 禁止仅使用用户名/密码登录。
这是我的 sshd_config 文件 - 我错过了什么吗?我已经尝试重新启动 SSH 和计算机本身。
# 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
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size …Run Code Online (Sandbox Code Playgroud)