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: