Configure scp to transfer files between Linux and Unix without a password

Source: Internet
Author: User
Tags scp file scp command scp command in linux

Configure scp to transfer files between Linux and Unix without a password

How to configure scp File Transfer

To implement scp file transfer between Linux and Unix, you first need to configure scp. By default, scp requires a password. You can complete file transfer between Linux and Unix without entering a password through the following configuration.

Assume that there are 2 Linux, A server, and B server (the ip address is assumed to be xxxx8). You need to transfer files (including directories) from A to B, and install BFagent on. Bkjia user on A and bkjia user on B

Machine

On server
Step 1: Go to/home/bkjia cd/home/bkjia (because we are using bkjia users. If other users are used, go to the directories of other users, such as cd/home/weblogic)
Second, create the. ssh directory, mkdir. ssh
Part 3: Go to the. ssh directory, cd. ssh
Step 4: Execute ssh-keygen-B 1024-t rsa

B server
Step 1: Go to/home/bkjia cd/home/bkjia (because we are using bkjia users. If other users are used, go to the directories of other users, such as cd/home/weblogic)
Second, create the. ssh directory, mkdir. ssh
Part 3: Go to the. ssh directory, cd. ssh
Part 4: Create new files authorized_keys and touch authorized_keys

On server
Step 5: Execute scp-p. ssh/id_rsa.pub bkjia@xxxx.238:/home/bkjia/. ssh/authorized_keys
Place the generated id_rsa.pub to the authorization key file on B server.
Part 6: Test file transmission. You can transmit a directory under/home/bkjia to B.
For example, you can transmit dir001 (which includes multiple files and directories) under/home/bkjia to the/home/bkjia/testdir directory on server B.
Scp-r dir001 bkjia@9.xxxx:/home/bkjia/testdir

B server

Step 5: Go to/home/bkjia/testdir and check the transmitted File

Cp/scp command + scp command in Linux

CentOS cannot use scp command Solution

Copy files between two Linux Hosts using scp

Press scp transmission speed

Accelerate scp Transmission

Shell implements scp for batch file delivery

Ten SCP transmission command examples

This article permanently updates the link address:

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.