Article Title: SSH Tips 1: create shortcuts. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
When managing servers, I usually use SSH. The following are some tips for using SSH.
Create shortcuts
When you log on to the server by executing an ssh Command, are you bored with a long string of parameters after the command? For example, to log on to the example.com host as a user named serveradmin@domain.com, You need to execute:
Ssh serveradmin@domain.com @ example.com
You can certainly use alias, but SSH also provides corresponding solutions-you can create shortcuts for remote hosts that require frequent access.
Check whether there is. ssh in your main directory. If not, use mkdir to create one;
Use your favorite Text Editor (such as Vim) to create the config configuration file:
Vim ~ /. Ssh/config
As described in the previous example, if the shortcut name I want to create is lt, add the following content, where HostName is the host name and User is the User name:
Host lt
HostName example.com
User serveradmin@domain.com
Save and edit.
Now, you only need to execute ssh lt.