11
Linux Servers Support / Regular user Can't SSH using public Key but root can
« Last post by Saahib on May 18, 2020, 12:19:59 AM »Hi,
This is driving me nuts from few days. I have server where I can login as root user through SSH using public key authentication. I then added new user with SSH.
Added new user :
Created password for it :
Added .ssh/authorized_keys with client machines public key (which is I am already using to log into as root from this client)
I have double checked, triple checked. Same key works for root login but not for new user.
I tried ssh to ssh with -v ,then last few lines:
It looks like its my ssh server is not able read publickey ? I can login using password though.
I have done this in past many times, for root and normal user but this time its not working, driving me nuts...
I am sure I am making some tiny mistake.. but where it is ?
This is driving me nuts from few days. I have server where I can login as root user through SSH using public key authentication. I then added new user with SSH.
Added new user :
Code: [Select]
adduser -m newUser
Created password for it :
Code: [Select]
passwd newUser
Added .ssh/authorized_keys with client machines public key (which is I am already using to log into as root from this client)
Code: [Select]
echo "key here from client" >> /home/newUser/.ssh/authorized_keys
I have double checked, triple checked. Same key works for root login but not for new user.
I tried ssh to ssh with -v ,then last few lines:
Code: [Select]
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: Next authentication method: password
newUser@server.com's password:
It looks like its my ssh server is not able read publickey ? I can login using password though.
I have done this in past many times, for root and normal user but this time its not working, driving me nuts...
I am sure I am making some tiny mistake.. but where it is ?