Bug 872608
Summary: | RequiredAuthentications2 does not work in Match blocks as documented. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Steven Haigh <netwiz> |
Component: | openssh | Assignee: | Petr Lautrbach <plautrba> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 18 | CC: | mattias.ellert, mgrepl, netwiz, plautrba, tmraz |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://bugzilla.mindrot.org/show_bug.cgi?id=983 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 869903 | Environment: | |
Last Closed: | 2012-12-07 03:28:59 UTC | 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
Steven Haigh
2012-11-02 14:43:00 UTC
This is also present on F18 using: # rpm -qa | grep openssh openssh-6.1p1-2.fc18.x86_64 openssh-clients-6.1p1-2.fc18.x86_64 openssh-server-6.1p1-2.fc18.x86_64 While I'm not 100% sure of the syntax here, I've also tried the following config: Match Address 203.56.246.89 X11Forwarding no AllowTcpForwarding no RequiredAuthentications2 publickey Match Address * X11Forwarding no AllowTcpForwarding no RequiredAuthentications2 publickey,password This has no effect any anyone can log in via public key only. Further to this.... If I disable all auth in the main config, then have the following: PasswordAuthentication no PubkeyAuthentication no Match Address 203.56.246.89 PubkeyAuthentication yes RequiredAuthentications2 publickey Match Address * PasswordAuthentication yes PubkeyAuthentication yes RequiredAuthentications2 publickey,password This gives me the result of: # /etc/init.d/sshd restart Stopping sshd: [FAILED] Starting sshd: /etc/ssh/sshd_config line 147: Invalid required authentication list Line 147 is the first RequiredAuthentications2 statment. Interestingly, the docs show that PasswordAuthentication and PubkeyAuthentication ARE supported keywords in a match block. ie: Only a subset of keywords may be used on the lines following a Match keyword. .... PubkeyAuthentication .... PasswordAuthentication ..... RequiredAuthentications1, RequiredAuthentications2 .... etc Maybe its something more than just the RequiredAuthentications2 keyword being broken? Full reproduction steps: 1) Take a working SSH server config with working public key auth. 2) Edit /etc/ssh/sshd_config and place the following near the Authentication block: RequiredAuthentications2 publickey,password 3) Save and restart sshd. Verify that you get prompted for a password after successful public key auth. Results should be something like: $ ssh root.here Authenticated with partial success. root.here's password: Last login: Tue Nov 6 16:47:35 2012 from your.last.login.host [root@test ~]# 4) Add a Match block to allow auth with ONLY publickey authentication to /etc/ssh/sshd_config. Replace xxx with the IP address of your machine: Match Address xxx.xxx.xxx.xxx RequiredAuthentications2 publickey 5) Save and restart sshd. Verify that you are still prompted for a password - even though publickey authentication was successful. $ ssh root.here Authenticated with partial success. root.here's password: At this point, login should proceed with ONLY a public key from the host listed. This is not currently the case. Thanks for the report and reproducer. I'm able to reproduce this issue and I'm working on a fix. I'd like also to adopt an upstream version of the "required authentication" feature so that it should be possible to use fixed RequiredAuthentications2 method or AuthenticationMethods from the upstream. I will also add warning that "RequiredAuthentications2" will be obsoleted in next fedora release since it's a dead end and the upstream has used another approach. There are two bugs. A RequiredAuthentications2 value is not stored in a Match block. And even if it was stored, it wouldn't be copied from Match sub config to main config. Both are fixed in this [1] scratch build. Please test if this build fixes your issue. [1] http://plautrba.fedorapeople.org/openssh/872608/ Hi Petr, I don't have any operating Fedora 18 systems to play with at the moment - my previous testing was a temporary VM - however I have *plenty* of EL6.3 systems to play with. Is it possible to get an el6 build of this to test as well? Maybe attached to #869903? - as that is the original that I cloned for this bug against F18. I just tested these on a Fedora 18 install. It now works correctly. Tested using the following config: RequiredAuthentications2 publickey,password Match Address 10.1.2.3/32 X11Forwarding no AllowTcpForwarding no RequiredAuthentications2 publickey Connections from that host correctly use publickey only - other hosts use BOTH publickey and password as expected. openssh-5.9p1-28.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/openssh-5.9p1-28.fc17 Package openssh-5.9p1-28.fc17: * should fix your issue, * was pushed to the Fedora 17 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing openssh-5.9p1-28.fc17' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-19252/openssh-5.9p1-28.fc17 then log in and leave karma (feedback). openssh-6.1p1-3.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/openssh-6.1p1-3.fc18 openssh-6.1p1-3.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report. openssh-5.9p1-28.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report. |