Bug 1855095

Summary: PasswordAuthentication not being used properly
Product: [Fedora] Fedora Documentation Reporter: Patrick Johnston <linux.pjohnston>
Component: system-administrator's-guideAssignee: Petr Bokoc <pbokoc>
Status: POST --- QA Contact: Fedora Docs QA <docs-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: develCC: crypto-team, dhensley, dwalsh, jfch, jhradile, jjelen, lkundrak, mattias.ellert, plautrba, swadeley, tmraz, zach
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Patrick Johnston 2020-07-08 23:41:52 UTC
Description of problem:
So as per the F32 Docs in order to disable Password Authentication, you edit sshd_config and set PasswordAuthentication no
Then you restart sshd

However, after restart if you issue ssh username@host -o PubkeyAuthentication=no
from client to verify that password authentication is disabled, you still are prompted to enter password.

Version-Release number of selected component (if applicable):
openssh-server.x86_64 8.3p1-3.fc32

How reproducible:
Can reproduce on fresh installs on both bare metal and VMs

Steps to Reproduce:
1. vim sshd_config and set PasswordAuthentication no
2. systemctl restart sshd
3. (from client) ssh username@host -o PubkeyAuthentication=no

Actual results:
Prompts for password authentication

Expected results:
Should get on client this prompt
username@host: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Additional info:
I did find a workaround.  If you edit sshd_config with following
Match User username
    PasswordAuthentication no

Then you obtain expected results, but that means on multi-user system would have to edit sshd_config everytime you add users

Comment 1 Jakub Jelen 2020-07-13 11:04:58 UTC
That sounds like a documentation issue. Please, update the bug with the appropriate documentation where you found this note.

The sshd_config now uses drop-in directory and /etc/ssh/sshd_config.d/50-redhat.conf, which is loaded before anything you modify in sshd_config directly.

Suggested solution is not to modify shipped configuration file, but create your own file /etc/ssh/sshd_config.d/30-local.conf (for example), which will get loaded before the distribution defaults.

Comment 2 Patrick Johnston 2020-07-13 17:45:27 UTC
https://docs.fedoraproject.org/en-US/fedora/f32/system-administrators-guide/infrastructure-services/OpenSSH/

This is the documentation that I was referring to previously.
And thank you for the suggested solution, have already made correction and now is working as intended.

Comment 3 Jakub Jelen 2020-07-14 07:21:07 UTC
Thanks. Reassigned to the correct guide. I will try to get it updated accordingly.

Comment 4 Jakub Jelen 2020-07-14 10:13:38 UTC
I filled the PR fixing several more issues that I noticed in the SSH section of the guide:

https://pagure.io/fedora-docs/system-administrators-guide/pull-request/54

Review and feedback welcomed.