Use ssh to create a key to log in to the remote server (centos6.6)

The ssh command is a client connection command that can securely log in to a remote server

First make sure that ssh is installed on the machine, use ssh -v to check the ssh version

If not installed, use the command yum install ssh to install

Generate a pair of secret keys (private key, and public key) through ssh-keygen -t rsa,

Keep pressing Enter, novices are advised not to set a password

When creating a generation, it will feedback the location of the generated key, such as in the /root/.ssh/ directory

Note that the .ssh directory is hidden, use the ls -a command to view all files in all current directories

The public key can be shared with others. By adding the keys of the corresponding user on the remote server, the client can send a request to connect through the ssh command

ssh -p 22 username@server IP -i /root/.ssh/id_rsa #(path where the private key is located)

Connection using root user

About ssh parameters use man ssh to view

cat /proc/vesion to see the running kernel version

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325485080&siteId=291194637