ssh connection remote server tips

Normal, every time you connect to the remote server, you need 1 ssh remotehost; 2 enter the password

In fact, step 1 can be simplified by configuring ~/.ssh/config, for example like this

Host corp
     User user
     HostName 192.168.xxx.xxx
     Port 22
     ServerAliveInterval 120
     ServerAliveCountMax 30
     IdentityFile ~/.ssh/id_rsa


In the future, you can directly ssh corp without entering lengthy ip addresses.


Second, test your own public key, that is, the things in id_rsa.pub to the server's ~/.ssh/authorized_keys, and then you don't need to enter the password.

Guess you like

Origin blog.csdn.net/cscj2010/article/details/41011613