You do not need to enter a password for Rsync transmission.
1. Background
1) one server: VM3 (IP: 3.9.8.151)
2) A client: VM2 (IP: 3.9.8.157)
3) The server and client can ping each other.
4) rsync has been installed on both the server and client.
Requirement: Copy all files in the/root/backup/directory of VM3 to the/root/test/directory of VM2.
2. Operation
1) Use
1. Perform rsync via SSH (password required)
Perform rsync through an SSH account (requiring a password) to mirror files synchronously to a remote server.The following example synchronizes the local/home/ramesh to the remote directory/backup/ramesh (server address 192.168.200.10).When you do the following, the server
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
xinted combined with rsync without password1. InstallationYum install-y xinetd rsync2. ConfigurationCat/etc/xinetd.d/rsync# default:off# description:the rsync server is a good addition to an FTP server, as it #allows CRC Checksumming Etc.serv Ice rsync{disable= noflags= ipv6socket_type = streamwait = Nouser = Rootserve
There are two types of rsync operations1. Start the rsync daemon2. Use remote shell to processOnly the second case is recorded here, which is simpler. In fact, rsync uses SSH to authenticate users. In the absence of SSH authentication, you generally need to enter the user name and password, for example:
=" Wkiol1cw9ctywbwbaaalli5sbom368.png "/>And then, looking at 1 92.168.200.130, we found that the thing that had just been transferred was/testing .650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/35/wKioL1cW9pHzWnemAABAjpZ6tTI858.png "title=" 777-6761-4b67-8cd1-b5035266856b.png "alt=" Wkiol1cw9phzwnemaabajpz6tti858.png "/>650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "border=" 0 "style=" Background:url ("/e/u261/ Lang/zh-cn/images/localimage.png ") no-repeat c
mode that rsync can write the password to a file. Note: The Rsync-daemon authentication method requires both the server and the client to install the Rsync service, and only the rsync server is required to start rsync and configu
Rsync architecture and rsync Architecture
1.1 rsync server configuration
1.1.1 view the server rsync version
1.1.2 after the rsync program is installed by default, the main configuration file of rsync is not automatically creat
synchronization.
Ii. System Environment
System Platform:CentOS release 6.3 (Final)
Rsync version:Rsync-3.0.9-2.el6.rfx.x86_64.rpm
Rsync server:TS-DEV (17w..1.135)
Rsync client:TS-CLIENT (172.16.1.136)
Iii. Installing rsync on the server
3.1. Check whether rsync has been ins
bandwidth.
Production parameters:-avz or-vzrtopg.
View the rsync installation package
Start rsync
Create an rsync user
Create shared directory/backup
Create a password file/etc/rsync. password
Modify the/etc/
bandwidth.
Production parameters:-avz or-vzrtopg.
View the rsync installation package
Start rsync
Create an rsync user
Create shared directory/backup
Create a password file/etc/rsync. password
Modify the/etc/
watch.Rsync Core Algorithm
The rsync algorithm is very efficient. I will not go into details about the core algorithm in an article on cool shell.Rsync server setup
You can set up an rsync server. rsync runs as a daemon. The client writes the rsync command into a shell script and regularly executes the script through
=" Wkiom1xjfnnhgajaaabfkycnaia689.jpg "/>Experiment (II)Experimental purpose: CentOS based rsync client + rsync server(downlink: rsync [email protected]:: Shared name local directory)(Upstream: rsync local directory [email protected]:: Share name)Service-Side requirements:The remote host needs to run the
@ inotify-slave ~] # Ls-ld/mydata/Drwxr-xr-x 2 rsync 6 May 19 21:02/mydata/
4. Configure the virtual user's password file/etc/rsync. password[Root @ inotify-slave ~] # Vim/etc/rsync. passwordBkjia: linux # "bkjia" indicates the virtual user name, and "linux" indicates the v
=/alidata/tmp/rsynctest #同步路径auth users = Neth o #使用用户必须是服务器真实用户secrets file =/alidata/passwd/rsync/rsyncd.pass #用户认证文件list = Noread only = no #只读Establish the authentication file, I use the Apache Authentication tool to generate a more complex password (too troublesome to manually enter the Echo Woshimima >/alidata/passwd/rsync/rsyncd.pass)Mkdir-p/alidata/passw
File
Rsync mainly includes the following three configuration files: rsyncd. conf (main configuration file), rsyncd. Secrets (password file), rsyncd. motd (rysnc Server Information)
Server configuration file (/etc/rsyncd. conf). This file does not exist by default. Please create it.
The procedure is as follows:
# Touch/etc/rsyncd. conf # create rsyncd. conf, which is the configuration file of the
refer to the documents on rsync.samba.org. Of course, we need to install the rsync software first;
A. Install rsync;
Obtain rsync
Rysnc Official Website: http://rsync.samba.org/you can get to the latest region from here. The latest version is 3.05. Of course, because rsync is such a useful software, many Linux release
service on the client.
[root@nfs01 ~]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::backup --password-file=/etc/rsync.passwordsending incremental file listsent 26 bytes received 8 bytes 3.24 bytes/sectotal size is 314 speedup is 9.24
3. No difference in rsync Data Synchronization
Client push[Root @ nfs01 data] # ls/data/a B c d e f g pull.txt [root @ nfs01
(primary configuration file), rsyncd.secrets (password file), RSYNCD.MOTD (RYSNC server information)
Server configuration file (/etc/rsyncd.conf), the file does not exist by default, create it.
The specific steps are as follows:
#touch/etc/rsyncd.conf #创建rsyncd. conf, this is the configuration file for the rsync server.#touch/etc/rsyncd.secrets #创建rsyncd. Secrets, this is the user
configuration file), rsyncd.secrets (password file), RSYNCD.MOTD (RYSNC server information)
Server configuration file (/etc/rsyncd.conf), the file does not exist by default, create it.
The specific steps are as follows:
#touch/etc/rsyncd.conf #创建rsyncd. conf, this is the configuration file for the rsync server.#touch/etc/rsyncd.secrets #创建rsyncd. Secrets, this is the user
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.