The client configuration is as follows:
1. Common Client Connection server code
SSH [email protected]-P port-I id_rsa-P port-I specify the Key Path-V to view the authentication process, debug
You need to configure the file as follows:
The configuration file is not changed. Create it manually.
~ /. Ssh/config
Host 248 hostname 192.168.28.248 User Root port 22 host 50 hostname 192.168.28.50 ### default for all #### override as per host # host * forwardagent no forwardx11 no forwardx11trusted Yes User Username Port protocol 2 serveraliveinterval 60 serveralivecountmax 30
Identityfile ~ /. Ssh/id_rsa
Usage: Enter SSH 50 on the terminal.
2. Set the id_rsa Private Key Permission to 600 and upload the public key to the server.
/Etc/ssh/ssh_config configuration file for the client
Port port Protocol 2 sendenv Lang lc_ctype lc_numeric lc_time when using lc_paper lc_name lc_address when using lc_identification lc_all else xmodifiers # sendenv Lang lc_all = en. US.UTF-8 hashknownhosts too many No
The server configuration is as follows:
/Etc/ssh/sshd_config configuration file for the server
Port changed to custom port no # acceptenv Lang LC _ * acceptenv Lang lc_ctype lc_numeric lc_time when lc_paper lc_name lc_address when lc_all else xmodifiers # allowgroups sshusedns No
Put the public key in the authorized_keys file under the root directory of the corresponding user on the server. The permission is very important. chmod 700 ~ /. Ssh chmod 600 ~ /. Ssh/authorized_keys
Reference: http://www.cyberciti.biz/faq/create-ssh-config-file-on-linux-unix/http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/http://dhq.me/use-ssh-config-manage-ssh-sessionhttp://hi.baidu.com/linuxtrip/item/3f630717939a86f5746a8427
The above configuration will be updated continuously
1. First release of 2014. 09.14
SSH personal configuration process