ssh mySshServer -v
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /path/to/myKey.pub ED25519 SHA256: explicit
debug1: Server accepts key: /path/to/myKey.pub ED25519 SHA256: explicit
Load key "/path/to/myKey.pub": error in libcrypto
Full error message :
unix_listener: cannot bind to path ~/.ssh/controlmasters/bob@sshServer:22.ZayS2hxgo4QCl1xG: No such file or directory
This is a pretty silly one () :
The path you've declared to store the SSH control sockets does not exist .
mkdir -p ~/.ssh/controlmasters
ssh myServer
Received disconnect from myServer port 22: Too many authentication failures
Authentication failed.
Many factors can cause a Permission denied (publickey). error. If you are not in the context of a locked / disabled password account, this article might be useless.
- I'm trying to setup a user account on a remote machine (sshServer) so that I can use it via SSH
- I plan to use SSH keys only, so bob's account password should be "disabled" so that I don't have to worry about it and can safely forget it.
- sshd has been setup + hardened
- But when I execute :
ssh bob@sshServer
I get :
bob@sshServer: Permission denied (publickey).
An SSH session dies regularly saying :
packet_write_wait: Connection to 10.27.25.35 port 22: Broken pipe
Full error message :
tcsetattr: Input/output error
Connection to mySshServer closed.
Have a look at this.
/var/log/auth.log contains many lines such as sshd[n]: Bad protocol version identification '\026\003\001' from 12.34.56.78
sshd expects the first thing that the client sends to be a version string. But since it's running on the HTTPS port, it's getting connections from clients that are sending encrypted SSL traffic. This is just meaningless, binary garbage, to sshd, hence the log entry.
Regarding the "protocol version identification" string (source) :
This is octal representation (base 8). During the initial steps of an SSH connection, the client and the server send each other the version(s) of the protocol they implement, as strings. These strings must follow a specific format.
Here, the server received from the client a "protocol version" string that does not make sense. Probably, the client was not trying to do some SSH at all, but instead some other protocol.