I've setup a clean new VPS running Ubuntu 20.04 LTS with Hetzner and would like to access it via ssh.
Here is what I've tried to do:
- I have added my public ssh key (passphrase-less) in Hetzner's online GUI. That looked something like this:
ssh-rsa blahblahblah= [email protected]
- But when I attempt to
ssh-copy-id
this key to the server, I run into issues. Since I haven't logged into the server to create users, I don't know what to put for theuser
in this command:
ssh-copy-id -i .ssh/id_rsa_pub [user]@serveraddress
I've tried adding the key to root user like so:
ssh-copy-id -i .ssh/id_rsa_pub [user]@serveraddress
But then I'm prompted for a password I don't know.
This leads me to the following questions I've had a hard time finding answers to:
1. How can I use ssh-copy-id
to copy my public key to the server if I haven't setup a user yet?
2. What is the default root
password on the server? How Would I find this out? I've tried ubuntu
, root
, the basics.
3. What does adding a public key via GUI on the server host's website normally do with regards to server users? Does it add the key to the known_hosts
file?
4. What is the technical significance of the final comment line in my public ssh key, currently [email protected]
?
You'd need the password for the user, and for SSH to accept passwords (not always the case). I wouldn't expect this to be the way forward in this sort of situation, where the VPS provider has a copy of your public key.
There's nothing guaranteed; it will be defined by the VPS provider, and should be in their documentation.
Close; it would add it to the .ssh/authorized_keys file in some users' home directory. As you've identified, knowing which user is opaque
Nothing technical, it's just a label for human use.