Password-less SSH SCP

Source: Internet
Author: User
Tags free ssh

 

General execution:

 

Java code

Scp/home/daisy/full.tar.gz root@172.19.2.75:/home/root

 

After the command is executed, enter the root ssh password of server B 172.19.2.75. After the input, the file is copied.

 

Password-free ssh configuration is not required for distributing SCP in Linux

 

 

On serverA:

Java code

# Ssh-keygen-t rsa

# Ls/root/. ssh

Id_rsa id_rsa.pub known_hosts

# Chmod 755/root/. ssh

# Chmod 600/root/id_rsa

# Scp id_rsa.pub serverB:/root/. ssh/authorized_keys

 

# Scp aa.txt serverB:/root

 

 

No Password is required in the future. Scp aa.txt serverB:/root

 

 

When ssh-keygen-t rsa is pushed, press Enter.

 

 

On serverA, chmod 755/root/. ssh

On serverA, chmod 600/root/id_rsa

 

 

Ssh-copy-id

 

Method 2: ssh-copy-id

Method 3:

[Code = & quot; code & quot;] # ssh-keygen

# Cat ~ /. Ssh/id_rsa.pub | ssh user @ server & quot; cat-& gt ;~ /. Ssh/authorized_keys & quot;

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.