Using SCP in Linux does not require a password to transfer files
I suddenly found that there was no backup file in the backup directory on the backup server. I checked it carefully and found that the scp command required a password. I have previously established a trust rela
" for the remote server1. Generate SSH private key and public key on a "the generated files are all in the ~/.ssh directory"[Plain]View PlainCopy
ssh-keygen-t RSA # #需要3次回车
Ssh-keygen-t Rsa-p # #仅一次回车
2, the public key of a is passed to the user directory of B. SSH folder in the Authorized_keys file[Plain]View PlainCopy
SCP ~/.ssh/id_rsa.pub [Email Protected]_host_or_ip:~/.ssh/authorized_keys # #希望每次自动登录用什么用户, here's b_user
Reference address: http://blog.chinaunix.net/u2/76835/showart.php? Id = 1359453
Note: add the blue text for me
Recently, I encountered a problem when writing a regular Python script. In this script, you need to use the SCP command to copy the local file to another machine for backup. However, you usually need to enter the user password after executing the
Scp command usageUsage: scp command
Scp can copy files between two linux Hosts;
Basic command format:Scp [optional parameter] file_source file_target
======Copy from local to remote
Copy a file:*
the server, and change the file name to authorized_keys.
[[Email protected] root] # SCP-P. Ssh/id_rsa.pub [email protected]:/root/. Ssh/authorized_keys
[Email protected]'s password:
Id_rsa.pub 100% | *************************** | 218
[[Email protected] root] #
When executing the preceding command, the root user of the two machines has not yet established a secu
Sometimes we use SCP when copying/moving files to another machine, because it is safer. However, if
It is annoying to enter passwords, especially in scripts. However, SSH has another key pair for verification.
. The following describes how to generate a key pair for your reference.
Step 1: generate a key pair. I use the RSA key. Run the command "ssh-keygen-t rsa"[User1 @ RH user1] $ ssh-keygen-T RSAGenerat
You can use the SCP command when you want to transfer files between two Linux hosts, without entering a password after establishing a trust relationship. Copy your local host user's SSH key file to the remote host user's ~/.ssh/authorized_keys file, assuming the local host linux100, remote host linux200
One, the user in the LINUX100 host
Run
#ssh-keygen-t RSA
-less login.1. Client Configuration
Create a webgod user with the same name in the client and server systems, log on to the client system as a webgod user, and use the ssh-keygen command to generate a key pair. When the system prompts you to Enter a password associated with the key, press Enter.
The two generated key files are stored in the. ssh subdirectory of the webgod user's home directory. The id_rsa
same authentication and security. SCP will request input password in authentication All files may require a special description of the server and the user to indicate that the file will be copied to/from a server. File replication between two remotely-enabled servers is allowed.SCP command Options-1 Mandatory SCP with
When you use Scp/ssh/rsync to transfer files, you will need to enter a password. The following is a method for password-free transfer of files.Suppose you want to transfer files between two hosts, Host_src Host_dst. HOST_SRC is the machine where the file source address resides, and HOST_DST is the machine where the destination address resides.1. On the HOST_SRC
This assumes that host a (192.168.100.3) is used to obtain a file for Host B (192.168.100.4).Execute the following command on host A to generate the pairing key: ssh-keygen-t RSA encounters a prompt to enter by default, and the public key is stored in the user directory. The SSH directory, such as root, is stored in:/root/.ssh/id_rsa.pub. Id_ in the. SSH directory Rsa.pub file is copied to host B's ~/.ssh/directory and renamed Authorized_keys to host
When you run a scheduled task to copy files, you need to enter a password to run the SCP command. Here, you can use a public key to automatically enter the password.
Specific operations:
Requirement: Copy test.tar on 192.168.0.2to 192.168.0.3.
On the 192.168.0.2 Server:Mkdir-P ~ /. SSHChmod 700 ~ /. SSHSsh-keygen-
, to copy the current file to a remote other host, you can command the following.scp/home/daisy/full.tar.gz [Email Protected]:/home/rootYou will then be prompted to enter the login password for the root user of the other 172.19.2.75 host, and then copy is started.It is also easy to copy files from the remote host to the current system if you want to do this in reverse.Scp[email protected]/full.tar.gz 172.19
Linux server scp does not require password configuration case: ▲ server A performs ssh connection to server B and server C, do not enter A password or www.2cto.com ▲ server A Copies files to server B and server C (the source file is on server A). do not enter A password for host A: 192.168.0.221 host B: 192.168.0...
Li
SCP command usage in Linux
SCP is short for secure copy. SCP is a secure remote file copy command based on SSH login in Linux. The SCP command of Linux can copy files and directories b
In the SCP times Bash:scp:command not found[root@51ou.com add_admin]# SCP Ocp_admin_privileges.mysql root@10.10.1.128:/rootroot@10.10.1.128 ' s Password:Bash:scp:command not foundLost connection
To see if the Openssh-clients package is installed on this computer
[Root@51ou.com add_admin]# rpm-q openssh-clients
If not, we need to install
All of the machines I have minimized installation, so many componen
Use scp, ssh, etc. without entering a password, scpsshYou do not need to enter a password when using scp or ssh.Echo scp-r root@132.12.22.35:/www/applog/backlog> exp2.shEcho scp-r/home/oracle root@10.10.252.5:/www/back/backdmp> ex
The above command copies the local music directory to the remote others directory, that is, there is a remote ../others/================
Scp command
============================
Scp can copy files between two linux hosts;
Basic command format:
Ubuntu does not require any additional configuration. For example, if you do not need to install ftp or other software, you can use the scp command to directly transfer files, which is really convenient! ✓ Dragon@192.168.253.137 :~ /You will be asked about your account's dragon password.
Ubuntu does not require any additional configuration. For example, if you d
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.