Can anyone help me with self-hosting (beginner problems, ssh) 

So, I'm a beginner trying to learn to self-host.

I got a domain and a hetzner cloud. I pointed the domain to the server with A-Type entries.

domain.censored TTL 86400 Type A Priority 0 Data censored

Same with
*domain.censored
and
www.domain.censored

Then I created an ssh key with a password on my computer and and added the public key to the hetzner cloud.

Now when I try
ssh ssh-username@domain
I always get
Permission denied, please try again.

What did I do wrong?

Can anyone help me with self-hosting (beginner problems, ssh) 

@PaulaToThePeople @metaphil did you create your server first and then added your ssh public key afterwards to the hetzner web interface? If so, then your server doesn't know about your key yet. Is your key on the server in the file $HOME/.ssh/authorized_keys or is it kissing there? Because that's the place your server is looking for your key in order to figure out if your key is allowed to log in at all.

Follow

Can anyone help me with self-hosting (beginner problems, ssh) 

@technicallypossible @metaphil Yes, I set the ssh key after creating the server. how do I find out if the key is on the server? talk to me as though I was a child.

· · Web · 1 · 0 · 0

Can anyone help me with self-hosting (beginner problems, ssh) 

@PaulaToThePeople @metaphil alright. In the Hetzner web interface you can access a virtual console of your server. It looks and works like you were sitting in front of the server's screen, but in your web browser. You can login to your server there and then type "cat $HOME/.ssh/authorized_keys" (without the quotes). If your public ssh key does not appear on your screen, that's the issue.

Can anyone help me with self-hosting (beginner problems, ssh) 

@technicallypossible I found the console, but it asks me for a login and neither the hetzner account login nor the ssh user & password let me in.

Can anyone help me with self-hosting (beginner problems, ssh) 

@PaulaToThePeople so you haven't done anything with your server yet? Then you can just delete and recreate the server, that should then also put your ssh public key in the right place. Once the Hetzner website knows your ssh key, it then will put it into every new server you create. You created your server when Hetzner didn't know your ssh key yet so it didn't put the key into the server when it was created.

Can anyone help me with self-hosting (beginner problems, ssh) 

@PaulaToThePeople recreating your server may or may not give it a new IP address so just be aware of that. You might need to adjust your DNS records.

Can anyone help me with self-hosting (beginner problems, ssh) 

@technicallypossible The IP address stayed the same.

Now when I try to ssh login, there is a new error message with:

Add correct host key in /home/paula/.ssh/known_hosts to get rid of this message.

But it doesn't tell me what the correct host key is or where to find it

Can anyone help me with self-hosting (beginner problems, ssh) 

@PaulaToThePeople with ssh, there are two keys. Your key, that you use to tell the server who you are. And the host key, that is the server's key to tell you that the server is actually the server you are trying to connect to and not some attacker's server that managed to squeeze into your connection. When you tried to connect to the (now deleted) server, you probably typed in "yes" to confirm the server's host key.

(to be continued)

Can anyone help me with self-hosting (beginner problems, ssh) 

@PaulaToThePeople now that you reset your server, it has a new host key that your PC doesn't recognize. Your PC already knows the old host key and so it doesn't trust the new one.
On your PC you need to delete the old host key of the server. Type into your terminal:

ssh-keygen -R "hostname"

Replace the hostname with the DNS name of your server. Or, if you used the IP directly, replace the hostname with the IP address of the server.

Can anyone help me with self-hosting (beginner problems, ssh) 

@technicallypossible okay, I did that. But I still get Permission denied.

Can anyone help me with self-hosting (beginner problems, ssh) 

@PaulaToThePeople I'm out of ideas for now. I'd need to go into the Hetzner website myself – maybe I can do that later if my partner lets me 😅

Can anyone help me with self-hosting (beginner problems, ssh) 

@technicallypossible Well thanks for getting me this far. At least I learned some stuff. :)

Sign in to participate in the conversation
Climate Justice Social

This is an official mastodon instance for activists of the global climate justice and social justice movement.