SSH noob here. I’m having trouble create a valid SSH configuration (in ~/.ssh/config) which allows multiple users to log in to the same remote host (a VPS on Digital Ocean, in this case).
A bit of background. I created a Droplet (VPS) on DO (Digital Ocean), and DO automatically applied the default public key I had already registered with them to the root user. This allows me to SSH in with no configuration on my end.
However, I added a second user (ron) on the Droplet and created an authorized_keys
file for that user to allow me to SSH in. This requires me to create a config file on my machine in order to log in as both users (ron and root). Here is the file I created (The IP address given is just an example):
Host 161.00.100.100
HostName 161.00.100.100
User ron
IdentityFile ~/.ssh/private_key_for_ron
IdentitiesOnly yes
Host 161.00.100.100
HostName 161.00.100.100
User root
IdentityFile ~/.ssh/private_key_for_root
IdentitiesOnly yes
After creating this, I can only SSH in to the remote server as user ron
and not root
. In case it’s helpful, the remote server on DO is Ubuntu and my local machine is Debian.
Can someone tell me what I’m doing wrong?
Thanks!