Bug 2720

Summary: Include username in "Permission denied (publickey)." message
Product: Portable OpenSSH Reporter: jg
Component: sshAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: enhancement CC: dtucker
Priority: P5    
Version: 7.2p2   
Hardware: Other   
OS: Linux   
Bug Depends on:    
Bug Blocks: 2698    

Description jg 2017-05-23 08:45:43 AEST
Can SSH include the username in the following message? It was the only reason login failed, but wasn't clear.

Currently this is the behaviour:
$ ssh -i "pass.pem" myserver123.amazonaws.com
Permission denied (publickey).

It of cause works if I do:
ssh -i "pass.pem" ubuntu@myserver123.amazonaws.com

What I would like to see is:

$ ssh -i "pass.pem" myserver123.amazonaws.com
juser@myserver123.amazonaws.com
Permission denied (publickey).

This means, we would realise that "juser" didn't have an account on that VM at Amazon.

Sound reasonable?
Comment 1 Darren Tucker 2017-06-14 10:40:04 AEST
Done, thanks.  It will be in the 7.6 release.

$ ssh -i /tmp/key localhost
dtucker@localhost: Permission denied (publickey,password,keyboard-interactive,hostbased).
Comment 2 jg 2017-06-14 11:37:25 AEST
Thank you Darren
Comment 3 Damien Miller 2021-04-23 15:03:36 AEST
closing resolved bugs as of 8.6p1 release