Password-less SSH in Linux

Source: Internet
Author: User

The script from spirit Xi zhiqu has completed password-free verification, saving time and effort.

Execution method sh nopasswd user remote_host

Before executing this script, confirm:

  • Id_dsa.pub already exists on the local machine. If no. Run the ssh-keygen-t dsa command to obtain the result.

  • Log on to the user's home directory on the remote machine. The. Ssh folder already exists. If no. Ssh folder is created.

Nopasswd: copy the locally generated id_dsa.pub to the home of the machine to be accessed, and then add the id_dsa.pub content~ /. Ssh/authorized_keys, and finally make sure the permission settings are correct.

#! /Bin/shscp ~ /. Ssh/id_dsa.pub $1 @ $2 :~ /Ssh $1 @ $2 "touch ~ /. Ssh/authorized_keys; CAT ~ /Id_dsa.pub> ~ /. Ssh/authorized_keys; chmod 644 ~ /. Ssh/authorized_keys; exit"

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.