I am trying to set up a new user on my remote server.
I have created a new user with sudo access.
adduser username
usermod -aG sudo username
Then in the /etc/ssh/sshd_config file I have allowed that user ssh access.
AllowUsers username root
and I restarted ssh.
service sshd reload
Finally I logged in as the user and copied my public ssh key into the ~/.ssh/authorized_keys file.
But I still get Permission denied (publickey) when I try to ssh as that user.
ssh [email protected]
I am able to ssh as the root user with no problems.
ssh [email protected]
Am I missing something?
~/.sshdirectory and the~/.ssh/authorized_keysfile in the users home directory? Where is the private key of that user used to authentication?~/.ssh directoryhasdrwxrwxr-x. The~/.ssh/authorized_keyshas-rw-rw-r--. The remote user has an ssh key in the~/.sshdirectory and so does my local user.sshwith the-vvvflags.ssh -vvvdebug3: send packet: type 50 debug2: we sent a publickey packet, wait for reply debug3: receive packet: type 51