Score:0

Can connect to Droplet only using root user

uy flag

I'm trying to set up a Digital Ocean Droplet, and i have created a new user to follow best practices and also so that i can run the code command, because it isn't allowed as the root user. I can login using ssh -i ~/.ssh/id_rsa root@droplet_ip but running ssh -i ~/.ssh/id_rsa my_user@droplet_ip returns my_user@droplet_ip: Permission denied (publickey).
Why is this issue occuring? I also have managed to change the user after logging in as root using sudo su my_user, but when I try to run code it says
mkdir: cannot create directory ‘’: No such file or directory which is very odd.
Any help will be greatly appreciated :)

llesh avatar
au flag
have you copied your public key to the droplet? `ssh-copy-id -i ~/.ssh/id_rsa.pub user@remoteDroplet`
Romek avatar
uy flag
This is what i get after running this command: ```/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/wsl_user/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys user@remoteDroplet: Permission denied (publickey).``` and if i do it as root@remoteDroplet i get ```/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.```
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.