1. Create public key, public key
SSH-KEYGEN-T RSA
Ignore it out of any hint, cheerful all the way to the end of it.
2. Copy the public key id_rsa.pub to the/HOME/USERNAME/.SSH directory of the remote machine and name it Authorized_keys
Method 1: One step in place: SCP ~/.ssh/id_rsa.pub [Email Protected]:~/.ssh/authorized_keys
Method 2: Copy the SCP ~/.ssh/id_rsa.pub [email protected]:~
login ssh [email protected]
Additional Cat id_rsa.pub >> Ssh/authorized_keys
All kinds of means, with you happy, anyway, copy in the past is more than multiple remote host replication ~ If you are logged in the user and remote login user consistent, you can directly ssh hostname direct Landing, the following will not be seen.
3, resolve the local login user and remote login user inconsistent
Well, this is very tangled, although not to enter the password, but also have to 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
In this way, the local and remote login user name inconsistency can also ssh hostname login.
Call it
SSH password-free login for non-root users