SSH Automatic Login (password-free)

Source: Internet
Author: User

SSH Automatic Login (password-free) is actually nothing difficult for me to enter the user name and password every time I use SSH, but it is relentlessly despised by my colleagues. T creates the Public Key 1ssh-keygen-t rsa and ignores any prompts from it. Press enter to the end happily ~ Copy the public key to the remote host and copy the Public Key id_rsa.pub to the remote host's/home/username /. the ssh directory is named authorized_keys # method 1. OS x can install ssh-copy-id through 'brew install ssh-copy-id' to install ssh-copy-id user @ host; # method 2cat ~ /. Ssh/id_rsa.pub | ssh user @ host "mkdir ~ /. Ssh; cat >> ~ /. Ssh/authorized_keys "multiple remote hosts can be copied multiple times ~ If your local login user is the same as the remote login user, you can directly log on to the ssh hostname directly. Solve the inconsistency between the local login user and the remote login user. Well, this is very difficult. Although you don't need to enter a password, you have to log in by Using ssh username @ hostname. It's not good, you know. In fact, the solution is also very simple (but my colleague told me that the old face is red), modify the local Login User ~ /. Create an ssh/config file if any. The content is as follows: Host theoden user liluoHost fili user liluoHost hostname user name, you can also log on to the local host by Using ssh hostname, which is inconsistent with the remote login username.

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.