I'm quite new to this, and I've looked through questions but haven't found one that quite matches my problem, or rather I didn't sufficiently understand them to be able to solve this issue.
I have a new server to which I can only access using a pre-generated SSH RSA key pair, which allows me to connect only to the default ubuntu
user
ssh -i .ssh/mykey ubuntu@ipaddr
On the server I created a new user, newuser
, and I'm trying to make it, so I can use my key that I connect to ubuntu
on that account as well, but I'm not sure how to accomplish this, so I can then delete the ubuntu
user.
ssh-copy-id -i .ssh/mykey.pub -o "IdentityFile .ssh/mykey" newuser@ipaddr
That though returns permission denied. How can I do this effectively? Any password login is disabled and can't be enabled in this instance.