Ubuntu configuration ssh password-free login

Source: Internet
Author: User

1. Install SSH:$ sudo apt-get install SSH 2. See if the catalog is generated. SSH:$ ls-al/home/ubuntu/ 3. If not, create the directory manually. SSH:$ mkdir/home/ubuntu/.ssh 4. Generate public and private keys:$ ssh-keygen-t dsa-p '-f ~/.SSH/ID_DSA or $ ssh-keygen-t RSA 5. Add the public key to the public key file used for authentication:$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys or CP ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys 6. Verify that the SSH installation is successful:$ ssh-version 7. Password-Free login:Copy the Id_rsa to the rest of the machines to log in to SSH x.x.x.x 8. Password-Free login:

To disable all users via SSH login to the system by user name + password, modify the/etc/ssh/sshd_config file, the Allow password verification this line to No:

# Change to No to disable tunnelled clear text passwords
Passwordauthentication No


If you only want to prevent some users from logging in to the SSH service with a password, you can use the password of the locked user in the passwd command as an example of the user:

Passwd-l User

Ubuntu configuration ssh password-free login

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.