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

Ubuntu 22.10 not allowing SSH with a password (worked in Ubuntu 22.04)

· 52CE 我爱测

Normally I connect to our Ubuntu servers with ssh using a shared key. That works. Occasionally I will change the /etc/ssh/sshd_config and set "PasswordAuthentication yes" to allow someone to connect using a password. If they conn…

问题原文

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

Normally I connect to our Ubuntu servers with ssh using a shared key. That works.

Occasionally I will change the /etc/ssh/sshd_config and set "PasswordAuthentication yes" to allow someone to connect using a password. If they connect without the -i option specifying a key, it will prompt them for a password

This behavior seems to have changed in the latest Ubuntu 22.10

Even with PasswordAuthentication yes in the sshd_config, attempting to ssh without a key, gives the error " Permission denied (publickey). " without ever prompting for a password

I have Ubuntu servers going back to 18 and this behavior is new.

I compared the sshd_config files between 22.04 servers (which prompt for a password) and the 22.10 servers (which don't) and all the options are configured the exact same

Any ideas what I am missing ?

Thanks

社区高分解答

原帖链接 · DevOps Coder · CC BY-SA 4.0

I stumbled on the same issue today. All documentation indicates to include PasswordAuthentication yes within /etc/ssh/sshd_config . on further investigation I noticed there's an include config option enabled. Include /etc/ssh/sshd_config.d/*.conf

Here's the path you are looking for....

Option 1: Disable the inheritance within /etc/ssh/sshd_config # Include /etc/ssh/sshd_config.d/*.conf and set PasswordAuthentication yes

Option 2: cd /etc/ssh/sshd_config.d
ls look for entries containing PasswordAuthentication no (this overrides any configuration entered in /etc/ssh/sshd_config) and set the value to yes. PasswordAuthentication no
I hope this helps.

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

资料来源与适用范围

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

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

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