Rsync Security Configuration and rsync Configuration

Source: Internet
Author: User

Rsync Security Configuration and rsync Configuration

I will not talk about rsync deployment here. This article mainly describes how to access rsync through the user name and password:

I. rsync server security configuration

1. Create a password file and modify permissions

Touch/etc/rsync. pass

Content: root: 123456

Modify/etc/rsync. pass to 600

chmod 600 /etc/rsync.pass

2. Modify the rsync configuration file/etc/rsyncd. conf.

Add the following two lines:

secrets file = /etc/rsync.passauth users = root

The configuration file contains the following content:

uid = rootpid file=/var/run/rsyncd.pidlog file=/var/log/rsyncd.logsecrets file = /etc/rsync.passauth users = root[temp]        path = /data0        read only = no
3. Restart the rsync Process

Kill the rsync process:

Ps-aux | grep rsync

Kill-9 $ {pid}


Start the rsync process:

Rsync -- daemon

Ii. Secure Access to the rsync Client

1. manually enter the password

rsync root@10.73.20.37::temp/yarn-site.xml .Password:
2. Create a password file and specify a password file based on configuration items.

Rsync root@10.73.20.37: temp/yarn-site.xml. -- password-file = rsync. pass

Here, rsync. pass only has the password 123456, the user name has been specified in the command line, and the rsync. pass File Permission is changed to 600.

3. export environment variable, password-free rsync

export RSYNC_PASSWORD=${pass}
After setting the environment variable RSYNC_PASSWORD, you can use rsync without a password:

rsync root@10.73.20.37::temp/yarn-site.xml .

The following describes the environment variable RSYNC_PASSWORD:

RSYNC_PASSWORD

Setting RSYNC_PASSWORD to the required password allows you to run

Authenticated rsync connections to an rsync dae-mon without user

Intervention. Note that this does not supply a password to a shell transport such as ssh.





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.