Bug 1390267 - ssh keeps asking for password even if there is permanent login failure
Summary: ssh keeps asking for password even if there is permanent login failure
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openssh
Version: 7.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Jakub Jelen
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-31 15:17 UTC by Dalibor Pospíšil
Modified: 2016-11-14 07:44 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-14 07:44:08 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Dalibor Pospíšil 2016-10-31 15:17:04 UTC
Description of problem:
If user's shell does not exist, sshd makes a not of that in log but still lets client to attempt login with another password. Sshd could act similarly as when /bin/false or /sbin/nologin is used as a shell.
There's no point of letting client to try another password if it is obvious that the login will fail again.

Version-Release number of selected component (if applicable):
openssh-6.6.1p1-31.el7

How reproducible:
100%

Steps to Reproduce:
1. useradd test -s /xyz
2. echo test | passwd --stdin test
3. ssh test.0.1

Actual results:
# ssh test.0.1
test.0.1's password: 
Permission denied, please try again.
test.0.1's password: 
Permission denied, please try again.
test.0.1's password: 

# cat /var/log/secure
Oct 31 16:11:58 sopos-rhel7-brq sshd[19365]: User test not allowed because shell /xyz does not exist
Oct 31 16:11:58 sopos-rhel7-brq sshd[19365]: input_userauth_request: invalid user test [preauth]
Oct 31 16:11:59 sopos-rhel7-brq unix_chkpwd[19367]: password check failed for user (test)


Expected results:
# ssh test.0.1
test.0.1's password: 
Permission denied, permanent error, giving up.

Comment 1 Jakub Jelen 2016-10-31 15:24:28 UTC
Hello Dalibor. It is not a bug. It is a (security) feature.

You don't want to tell all the people on the internet that this account does not exists, does not have shell or does not have password. You want to behave the same way for all the accounts and not give any side channel information, which could be used against you.

I don't want to close the bug with the first comment so I will give you some time to think about it, if it is clear from my explanation (if not, feel free to ask). But certainly, we are not going to change this behavior.


Note You need to log in before you can comment on or make changes to this bug.