Creating Aliases for SSH Connections

Here’s a tip if you have some servers that you need to connect to often, especially if they have a long name and need a username that doesn’t match with the one on your local system, and even more so if you need to use an identity file, that is not the default one. The command would look something like this: ssh some_user@server1-qualifier.region.company.com -i ~/.ssh/server1_id_rsa` It’s possible to simplify this by creating an alias with all the required params in ~/.ssh/config file. Here’s how it would look for this scenario: ...

December 10, 2023 · Andrius

Copying OpenSSH Public Key

For the longest time to achieve passwordless login on a server I was doing the following: manually connected to the server created the .ssh directory if it didn’t exist created the authorized_keys file inside that directory and pasted the contents of previously copied public key crucial step was to set the correct permissions: 700 for the directory and 600 for the file But as with many things, there’s a script for that! It’s named ssh-copy-id and it’s part of the openssh package. Copying the public key to a server myserver is as easy as doing this: ...

December 9, 2023 · Andrius