Answer the question
In order to leave comments, you need to log in
Why can't I connect to DigitalOcean via ssh?
Registered on DigitalOcean, created a droplet. I'm trying to connect via ssh but it doesn't work. There are private and public keys. I did it on the local machine ssh-keygen -t rsa
. Two files were created in the folder /home/mikefromru/.ssh
1) id_rsa 2) id_rsa.pub.
I copied the contents of id_rsa.pub and pasted it into the public key field on DigitalOcean.
On the local computer I do: ssh -i ~/.ssh/id_rsa [email protected]_ip_on_digital_ocean
# try to transfer the private key.
Nothing happens, the usual new line in the terminal.
Execute ssh-copy-id [email protected]_ip_on_digital_ocean
# nothing happens
Execute ssh [email protected]_ip_on_digital_ocean
# nothing happens.
Through the console on DigitalOcean itself, using the usual password sent to email, it turns out to log in.
How to connect via ssh? what did/do I do wrong?
Answer the question
In order to leave comments, you need to log in
Above the field for inserting a key, it says that this will not add the key to existing droplets.
There is also a link on how to add to existing ones.
You can do it yourself. Log in with a password, /root
create a folder .ssh
with permissions in the folder 700
. In it, create a file authorized_keys
in which to insert the text of the public key and
mkdir -p /root/.ssh
chmod 700 /root/.ssh
echo "ваш пуб.ключ тут" >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question