The previous post discussed the private key login, which saves you from having to enter your password every time. In this blog, I'll share the ssh config file to help you log in with your Linux hostname.
Previous login method
In the previous blog, you needed to enter the full command to log in. There is an easy way to simplify that command.
Host ali # The host name User root HostName 1.2.3.4 Port 22 IdentityFile ~/.ssh/id_rsa_test
You may create this file to help OpenSSH identify the host you want to login, and the command will be:
1
~ ❤ ssh ali
Share some configurations
Here are some common configurations for GitHub and other public repositories.
You can copy the content, but you need to replace the config file with your private key path.