ssh-keygen with ssh_config password-free login vpsposted by Fiture/December 29, 2012/"ubuntu""share" used terminal login remote server or VPS of children's shoes have used similar command: SSH [email protected], enter the password can log on to the remote server, but people are always lazy, here, Password-free method to log on to a remote server: Open terminal, locally generate ID_RSA (private key), id_rsa.pub (public key): SSH-keygen-t RSA (press the ENTER key all the way): SSH-the Keygen public key (id_rsa.pub) and private key (ID_RSA) are generated by default in:~/.ssh/directory. Copy the public key to the remote server, or anywhere else WHATEVER...SCP~/.ssh/id_rsa.pub [Email protected]:~/.ssh/the username above is replaced with your username, and the server address. Then you need to log on to your remote server to operate. Log on to the remote server operation SSH [email protected] Enter the password and login, perhaps the last time you logged on to the server requires a password. Cat~/.ssh/id_rsa.pub >> ~/.ssh/Authorized_keys is done, logout if you do not have the operation error, you can enter SSH [email protected] Login server, do not enter the password. Configuring SSH Configtouch~/.ssh/Config Create a new custom SSH config file vim~/.ssh/config with vim or other Editor open config file, configure config, paste the following format content, Save: Host VPS (here is a custom host abbreviation, later connected to the remote server can use the command SSH VPS) user here fill in the username ( such as: root) HostName here to fill the server address can also be a domain name (such as: server.xxoo.com) Port here to fill the server open-SSH Port (default: A) Identityfile Here is the private key file address that was just generated, such as~/.ssh/Id_rsa) In fact, this thing can be used to configure you to connect to different remote servers, such as two GitHub accounts, or two Git servers and so on. It seems that you can now login to the remote server with SSH VPS. have been unable to remember these things, first on this note, for reference only. Ps..sshThe-T in the-keygen command represents the type of makefile, such as RSA,DSA, and so on, and the-c parameter seems to be a comment, provides aNewComment. If you use Ssh-keygen-t rsa-c"comment content, usually e-mail address", the generated public key is followed by comments, for the time being I don't know what to do with it ... More information: http://Www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygenhttp://Www.openbsd.org/cgi-bin/man.cgi?query=ssh_config
Ssh-keygen with ssh_config password-free login VPS