Linux under SSH password-free login remote server configuration

Source: Internet
Author: User
Tags ssh ssh port

It is very easy to use SSH to log on to a remote host under Linux, but for lazy people, it is a very painful thing to enter the password frequently, and then you can login to the server without entering the remote host password.
The following operations are done on the local host, not the root user, and the system is a Debian wheezy.

Local Host:

Ssh-keygen-b 1024-t RSA

Pressing ENTER ENTER key continuously will generate two files under ~/.ssh/:

Id_rsa id_rsa.pub

All we need to do is upload id_rsa.pub to the remote host.

#远程主机添加. SSH Directory

SSH leung@192.168.1.10 ' mkdir ~/.ssh '

Append the local host's id_rsa.pub to the remote host's ~/.ssh/authorized_keys and specify the port if the remote host SSH port is not 22:
Cat ~/.ssh/id_rsa.pub | SSH leung@192.168.1.10 ' cat->> ~/.ssh/authorized_keys '

Test:

SSH leung@192.168.1.10

Successfully logged on to the remote host and the setup succeeded.

The above is a simplified version of the operation, if you want to split operation, you can id_rsa.pub the local host SCP to the remote host, and then log on to the remote host, manually append id_rsa.pub content to Authorized_keys.

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.