I can access my server via ssh using root@{ip}
- I then create a new user
adduser username - I add the user to the sudo group
usermod -aG sudo username - I add my public key to the authorized_keys of the new user
sudo cp /root/.ssh/authorized_keys /home/username/.ssh/authorized_keys - I then try to ssh into the server as the new user
ssh username@{ip} - I get the error:
Permission denied (publickey).
I know there are lots of similar questions but I can't figure out what I've done wrong. Please help!
I'm using a DigitalOcean Ubuntu droplet.
I've tried changing the owner of the authorised_keys file, changing permissions to 777, restarting the ssh service and some others.