Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/books/learning_rsync/03_rsync_demo02.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ update: 2021-11-04
# Demonstration based on rsync protocol
In vsftpd, there are virtual users (impersonated users customized by the administrator) because it is not safe to use anonymous users and local users. We know that a server based on the SSH protocol must ensure that there is a system of users. When there are many synchronization requirements, it may be necessary to create many users. This obviously does not meet the GNU/Linux operation and maintenance standards (the more users, the more insecure), in rsync, for security reasons, there is an rsync protocol authentication login method.

**How ​​to do it?**
**How to do it?**

Just write the corresponding parameters and values ​​in the configuration file. In Rocky Linux 8, you need to manually create the file <font color=red>/etc/rsyncd.conf</font>.
Just write the corresponding parameters and values in the configuration file. In Rocky Linux 8, you need to manually create the file <font color=red>/etc/rsyncd.conf</font>.

```bash
[root@Rocky ~]# touch /etc/rsyncd.conf
[root@Rocky ~]# vim /etc/rsyncd.conf
```

Some parameters and values ​​of this file are as follows, [ here ](04_rsync_configure.md) has more parameter descriptions:
Some parameters and values of this file are as follows, [ here ](04_rsync_configure.md) has more parameter descriptions:

|Item|Description|
|---|---|
Expand All @@ -28,14 +28,14 @@ Some parameters and values ​​of this file are as follows, [ here ](04_rsync_
| [share] | Share name |
| comment = rsync | Remarks or description information |
| path = /rsync/ | The system path location where it is located |
| read only = yes| yes means read only, no means read and write |
| dont compress = \*.gz \*.gz2 \*.zip | Which file types do not compress it |
| auth users = li| Enable virtual users and define what a virtual user is called. Need to create it yourself|
| read only = yes | yes means read only, no means read and write |
| do not compress = \*.gz \*.gz2 \*.zip | Which file types do not compress it |
| auth users = li | Enable virtual users and define what a virtual user is called. Need to create it yourself|
| secrets file = /etc/rsyncd_users.db | Used to specify the location of the virtual user's password file, which must end in .db. The content format of the file is "Username: Password", one per line |

!!! tip "tip"

The permission of the password file must be <font color=red>600</font>
The permission of the password file must be <font color=red>600</font>.

Write some file content to <font color=red>/etc/rsyncd.conf</font>, and write the user name and password to /etc/rsyncd_users.db, the permission is 600

Expand Down
2 changes: 1 addition & 1 deletion docs/books/learning_rsync/04_rsync_configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In the previous article [ rsync demo 02 ](03_rsync_demo02.md) we introduced some
|Parameters|Description|
|---|---|
| fake super = yes | yes means that you do not need the daemon to run as root to store the complete attributes of the file. |
| uid = | |
| uid = | user id |
| gid = | Two parameters are used to specify the user and group used to transfer files when running the rsync daemon as root. The default is nobody |
| use chroot = yes | Whether the root directory needs to be locked before transmission, yes yes, no no. In order to increase security, rsync defaults to yes. |
| max connections = 4 | The maximum number of connections allowed, the default value is 0, which means that there is no restriction |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ With inotify-tools, this program tool can realize one-way real-time synchronizat

## SSH protocol password-free authentication login

First, generate a public key and private key pair on the client, and keep pressing Enter after typing the command. The key pair is saved in the <font color=red>/root/.ssh/</font> directory
First, generate a public key and private key pair on the client, and keep pressing Enter after typing the command. The key pair is saved in the <font color=red>/root/.ssh/</font> directory.

```bash
[root@fedora ~]# ssh-keygen -t rsa -b 2048
Expand Down
2 changes: 1 addition & 1 deletion docs/books/learning_rsync/06_rsync_inotify.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The event types are as follows:
| move_self | The monitored file or directory has been moved |
| create | There are files or directories created in the monitored directory |
| delete | A file or directory in the monitored directory is deleted |
| delete_self | File or directory and delete |
| delete_self | File or directory delete |
| unmount | File system containing unmounted files or directories |

Example: `[root@Rocky ~]# inotifywait -mrq -e create,delete /rsync/`
Expand Down
2 changes: 1 addition & 1 deletion docs/books/learning_rsync/07_rsync_unison_use.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ update: 2021-11-06

As we mentioned earlier, one-way synchronization uses rsync + inotify-tools. In some special usage scenarios, two-way synchronization may be required, which requires inotify-tools + unison.

## Environmental preparation
## Environment preparation

* Both Rocky Linux 8 and Fedora 34 require source code compilation and installation **inotify-tools**, which is not specifically expanded here.
* Both machines must be password-free login authentication, here we use the SSH protocol for
Expand Down