SSH Automatic Login (password-free) is actually nothing difficult for me to enter the user name and password every time I use SSH, but it is relentlessly despised by my colleagues. T creates the Public Key 1ssh-keygen-t rsa and ignores any prompts from it. Press enter to the end happily ~ Copy the public key to the remote host and copy the Public Key id_rsa.pub to the remote host's/home/username /. the ssh directory is named authorized_keys # method 1. OS x can install ssh-copy-id through 'brew install ssh-copy-id' to install ssh-copy-id user @ host; # method 2cat ~ /. Ssh/id_rsa.pub | ssh user @ host "mkdir ~ /. Ssh; cat >> ~ /. Ssh/authorized_keys "multiple remote hosts can be copied multiple times ~ If your local login user is the same as the remote login user, you can directly log on to the ssh hostname directly. Solve the inconsistency between the local login user and the remote login user. Well, this is very difficult. Although you don't need to enter a password, you have to log in by Using ssh username @ hostname. It's not good, you know. In fact, the solution is also very simple (but my colleague told me that the old face is red), modify the local Login User ~ /. Create an ssh/config file if any. The content is as follows: Host theoden user liluoHost fili user liluoHost hostname user name, you can also log on to the local host by Using ssh hostname, which is inconsistent with the remote login username.