SSH password-free logon and simplified usage

Source: Internet
Author: User

We know that the public key is used for publishing, encrypting data for others, and then encrypting the data to be transmitted through the Public Key. When it is transmitted to itself, it can be decrypted with its own private key.

Check whether there is a public key file in the. Ssh directory of the user (such as root). If it is RSA encryption, check whether the file/root/. Ssh/id_rsa.pub exists. If the file does not exist, use the ssh-keygen command to generate the file and copy the file to the Home Directory of the username used for logon to the server to be accessed. in ssh/authorized_keys, if this directory and file do not exist, you need to create a new one. Then, change the file attribute to 600 (chmod 600 ~ /. Ssh/authorized_keys ). For security, change the. Ssh attribute to 700.

In this way, you do not need to enter the password after SSH [email protected. If you frequently use SSH to log on, you need to enter the user name and IP address, which is still troublesome. There is always a way for a lazy person to log on. Give it an alias in. bashrc of the current user on your machine, such as getin (any character or string you want, but do not repeat the existing command name ):
Alias getin = 'ssh [email protected]'

In this way, after you restart and enter the machine alias to take effect, you can directly input the command getin. In this way, enter a few simple characters to enter the server.

Likewise, you can use the following method to copy an object:
SCP your_local_file [email protected]:/server_path /... /
In this way, you do not need to connect to FTP. You can even copy the above "[email protected]:/server_path /... /"Is put into an environment variable through export, and then use this variable, you can enter less characters, copying is also as easy as local.

SSH password-free logon and simplified usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.