Unable to ssh in to new Debian DC instance

dreamcompute

#1

Laptop: ssh-keygen -t rsa -f cloud.key
Generating public/private rsa key pair.
Your identification has been saved in cloud.key.
Your public key has been saved in cloud.key.pub.

DC control panel: import key pair
DC control panel: named key pair "newkey"
Laptop: open cloud.key.pub in text editor, copy, paste into DC control panel, everything ok
Laptop: ssh -i ~/.ssh/cloud.key debian@111.222.333.444

That’s what I’m doing. It repeatedly asks me for a password, and according to DH support, this is a sign something is failing somewhere… it should not ask for a pw but instead just kick me into a shell session as user ‘debian’.

Any thoughts? Support seems to be running out of gas on getting back to me.


#2

Are you sure that when you created the virtual machine you have added the key to it? It’s quite common for people to miss the step. Try creating the machine from https://cloud.dreamhost.com and see if you still have that issue.

Edit: remember that you cannot inject the key into a running machine. You will have to destroy and re-create it.


#3

Tried two more servers created at cloud.dreamhost.com and get the same result… asks for a pw.

The first I tried creating with an existing ssh key.

The second I tried creating with importing an ssh key.

I’m using Mac Terminal app.

ssh debian@208.113.130.109
ssh debian@208.113.128.231
ssh -i ~/.ssh/cloud.key debian@208.113.128.231
ssh -i ~/.ssh/cloud.key debian@208.113.130.109

…all the same. Asks for pw.


#4

I have ten billion for anyone who can spin up a server and get into it right away via ssh on a Mac, and can write here the steps you do to make it work.
[hr]
I must have set some kind of record. I just spun up 10 servers, most Debian, some Ubuntu. The exercises all end with asking for a pw or Permission denied (publickey).

I tried importing ssh key during creation, and using existing ssh keys, changing the arguments in my ssh command correspondingly. No dice.

I haven’t heard from DH support in 10 hours now.

Phonecall time?


#5

Here are the steps I would suggest:

[list=1]
[] Create an ssh key on your Mac: See step 1 on this guide https://help.dreamhost.com/hc/en-us/articles/216499537-How-to-configure-passwordless-login-in-Mac-OS-X-and-Linux
[
] Upload the newly created public key to DreamCompute, follow this guide https://help.dreamhost.com/hc/en-us/articles/214843617-How-to-upload-an-SSH-key-via-the-web-UI
[] Create a new Debian machine and make sure you assign the SSH key to the machine. IT’s easy to forget this step.
[
] Connect to the newly created VM, the default username is debian for Debian OS, ubuntu for Ubuntu.
[/list]

My advice is do not create a key using the DreamCompute control panel: trust your desktop tools, make your key and learn how to use them to connect to all your servers because they’re so much more convenient than passwords (see https://www.dreamhost.com/blog/2016/05/28/one-great-reason-to-learn-how-to-use-ssh/).