I am using CentOS 6.5. SSH authentication fails with both public key (id_rsa) and using password (after public key attempt). This is happening when I am trying to connect to a remote node (with identical home directory - nfs share) or to localhost. On the other hand, SSH authentication and passwordless login works fine from root account (can ssh to and from remove node).

When I am logged in as user, the verbose mode first shows that public key was sent, but it never gets accepted and password method of authentication is selected next. However, even password method doesn't work. I am prompter to enter password three times and all fail. Same problems are repeated if I try to create a brand new user.

Here are some of the commands that fail (to remove node and to localhost):

ssh -v user@n100
ssh -v user@m0
ssh -v user@localhost
ssh -v user@

Why SSH doesn't work from user acount?

  • it would help if you updated your question and only mentioned exactly what you have and what you want ... seeing too many unrelated details – Scott Stensland Mar 10 '17 at 21:29
  • 2
    Does your remote user have a ~/.ssh/authorized_keys with suitable permission? (I.e. not writable by anybody else?) – Ulrich Schwarz Mar 10 '17 at 21:39
  • On the remote node as the user that's having problems please provide the result of f="$HOME/.ssh/authorized_keys"; while true; do ls -ld "$f"; test / == "$f" && break; f=$(dirname "$f"); done – roaima Mar 11 '17 at 16:34

Nope, you are doing it wrong, do not wait for ssh loops to match your luck, supply it directly:

ssh password authentication:

~# ssh root@server -o PreferredAuthentications=password

Testing it, my server returned Permission denied (publickey), It's only accepting publickey (So I don't need an option to specify that):

~# ssh root@server -i /home/abdullah/.ssh/server_key

Since my server key is located at my home directory (in .ssh folder) and I'm currently logged as root, I had to specify that key with the option '[-i identity_file]'.

But my key is encrypted and I got the message:

Enter passphrase for key '/home/abdullah/.ssh/server_key':
| improve this answer | |
  • I can't ssh even to localhost itself from the user. – 21347924720932423 Mar 13 '17 at 14:42
  • @21347924720932423 can you supply the command you are using and the output? also try to use the hostname not localhost – Abdullah Mar 13 '17 at 17:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.