AOG Poston
a software engineer

Same hostname but different keys or usernames
by Montana Poston on 07/03/23

I recently set up multiple users on a server and wanted to change my ssh config file to allow me to add aliases for both users.

Takeaway: OpenSSH allows you to onto the config file, so copy the ssh credentials, paste them, then change the "Host" parameter to another name.

The resulting config file looks something like this:

filename: ~/.ssh/config

Host root_for_my_server
Hostname domainname.com
IdentityFile ~/.ssh/rsa_1
IdentitiesOnly yes

Host admin_for_my_server
Hostname domainname.com
IdentityFile ~/.ssh/rsa_1
IdentitiesOnly yes