Set SSH automatic login (password-free, username) 1, create public key, public key ssh-keygen-t RSA ignore any hint that it comes out, cheerful all the way back to the end. 2. Copy the public key id_rsa.pub to the/HOME/USERNAME/.SSH directory of the remote machine and name it as Authorized_keys Method 1: One step in place: SCP ~/.ssh/id_rsa.pub [Email protected]:~ /.ssh/authorized_keys Method 2: Copy SCP ~/.ssh/id_rsa.pub [email protected]:~ login ssh [email protected] Append cat id_rsa.pub >&G t;. ssh/authorized_keys all kinds of means, as you are happy, anyway, copy the past is more than one remote host on multiple replication ~ if you log on the user and remote login users in line with the same, you can directly ssh hostname directly landed, the following will not be seen. 3, to solve the local login user and remote login inconsistent Well, this thing is very tangled, although not to enter the password, but also ssh [email protected] to login, very uncomfortable, you understand. In fact, the solution is also very simple (but the colleague told me, Old face a red), modify the local login user's ~/.ssh/config file, if the wood has to build a bar, the content is as follows: Host hostname user Username host Hostname2 User UserName2 this way, the local and remote login usernames are inconsistent and can ssh hostname login. Call it
Set SSH automatic login (password-free, user name)