AdminTalk - Talk to Learn

Navigation
Hệ điều hành Linux Những thông tin, kiến thức hay, cơ bản, thủ thuật và kinh nghiệm khi sử dụng trên các hệ điều hành Linux

Đề mục chính

Cấu trúc diễn đàn
Thông tin tổng hợp
Thông báo và quy định chung
Đóng góp ý kiến
Những bài viết có giá trị
Tin tức công nghệ
•• Tin tức công nghệ thông tin
•• Doanh Nghiệp & Người Tiêu Dùng
Premium Server, Hosting Support
Web Hosting / Domain
•• Kiến thức cơ bản về Web Hosting/Domain
•• Plesk - CPanel
Server / VPS
•• Kiến thức cơ bản Server - VPS
•• Server Review/ Hardware
•• Mail Server - AntiSPAM
Virtuozzo - VMWare - HyperV
•• For Windows
•• For Linux
Security
•• Mạng Wan - Lan
•• Internet - Virus - Hacker
VoIP
•• Kiến Thức Cơ Bản VoIP
•• Phần Cứng VoIP
•• Phần Mềm VoIP
•• Nhà cung cấp VoIP
Server Operating System
Linux Server
Windows Server 200x
Computer Supports and Discussion
Operating System
•• Hệ điều hành Linux
•• Hệ điều hành Windows
•• Hệ điều hành Mac
•• Hệ điều hành Chrome
Laptop, Netbook
Hardware
•• Cpu Intel
•• Cpu AMD
•• PSU, Overclocking & Cooling
•• Mainboard & Memory
•• Đồ họa máy tính
•• Kinh nghiệm
Software
•• Linux Apps
•• Windows Apps
Webmaster Area
Webmaster talk
Programming Language
•• HTML & CSS
•• PHP
•• C++ / C#
•• .NET
•• Java
•• Other
Graphic & Mutimedia
SEO (Search Engine Optimization)
Browsers
•• Mozilla Firefox
•• Chrome
•• Internet Explorer
Thủ Thuật Internet
Thương mại điện tử
•• Hình thức thanh toán
•• Giải pháp
HiTech, Mobile, Movies, Music, eBooks, Relax
Tablet PC
•• iPad
Mobile
•• iPhone
•• BlackBerry
•• Others
Movies
•• Download phim HD
•• Download phim DVD
Music
•• Download nhạc Lossless Album
•• Download nhạc Lossless tuyển chọn
eBooks - Tài liệu
•• Tin học - Lập trình
•• Khoa học - Kỹ thuật
•• Ngoại Ngữ
•• Tutorials - Training
•• Kinh tế
•• Thể Loại Khác
Bài học trong cuộc sống
AdminTalk – Talk to You
Introduce Youself
Off topic/ Chatting
Mua bán - Rao vặt - Tuyển dụng
Quảng cáo
Tuyển dụng

Bầu chọn mới nhất
Bạn nghĩ sao về công nghệ USB 3.0 ?

Rất tuyệt! Sẽ sử dụng ngay nếu được bán trên thị trường: 47.37%

Tốt hơn USB 2.0 , nhưng giá có thể mắc hơn nhiều: 42.11%

Bình thường thôi, công nghệ luôn thay đổi mà: 10.53%

Không quan tâm lắm: 0%
Voters: 38. You may not vote on this poll

Thống kê
Đề tài: 10610
Bài gửi: 12174
Thành viên: 20,205
Thành viên tích cực: 81
Xin cùng nhau chào đón thành viên mới nhất: ddvtien
Kỷ lục: 624 người đã ghé thăm 17/11/2010 lúc 06:16 AM.
Thành viên mới:
Hôm qua
- ddvtien
Hôm qua
- thanhtam1028
Hôm qua
- goodhealthvn1
Hôm qua
- honghobao286
07/02/2012
- condau
07/02/2012
- timlaibautroi7408
07/02/2012
- NguyenLien
07/02/2012
- quydona
06/02/2012
- hhhh11
06/02/2012
- danit

Số người đang xem
View Who's Online Thành viên: 1
Khách: 64
Tổng: 65
Nhóm: 0
Nhóm:  
Thành viên:  aviomobile
Mở Sổ Bạn Bè

Trả lời
 
LinkBack Ðiều Chỉnh Kiếm Trong Bài Xếp Bài

  #1 (permalink)
Old 28/02/2010, 11:02 PM
Linux Synchonize

Chip
Admintalk's Staff
can't stop talking
 
Chip's Avatar
 
Tham gia ngày: Apr 2008
Nơi Cư Ngụ: Germany
Bài gởi: 4,003
My Mood:
Thanks: 27
Thanked 210 Times in 152 Posts
VP: 0.00
Donate
Send a message via MSN to Chip Send a message via Yahoo to Chip Send a message via Skype™ to Chip
[Chỉ có thành viên mới thấy links này. ]

This document is meant to very quickly show how one can get a basic rsync server set up in Linux. For further information on rsync, see [Chỉ có thành viên mới thấy links này. ] or [Chỉ có thành viên mới thấy links này. ]. I'd appreciate any feedback you leave me, so I know whether this doc is helpful, and how to improve it in the future.

  1. Get rsync. If your distro doesn't have packages, hit [Chỉ có thành viên mới thấy links này. ].
  2. Create a file: "/etc/rsyncd.conf", with the contents:

    max connections = 2
    log file = /var/log/rsync.log
    timeout = 300

    [pub]
    comment = Random things available for download
    path = /path/to/my/public/share
    read only = yes
    list = yes
    uid = nobody
    gid = nobody
    auth users = pub
    secrets file = /etc/rsyncd.secrets
    This will create a module named "pub" that points to "/path/to/my/public/share", is read-only, allows access only to rsync user "pub", and verifies the password from "/etc/rsyncd.secrets". Note that this runs the rsync process as user and group "nobody", so you may want to make the the files world readable (chmod a+r), and the directories world listable (chmod a+x). Also, if a user connects to your rsync without any files/dirs specified, this share will be listed.
    Note: On Debian, group "nobody" doesn't exist. Use "nogroup" instead (same thing, different name) for the "gid" line. The same may be true for your distro if you get "invalid gid" errors when testing rsync.
    Optional: Some have asked how to control access to rsync by IP address or hostname. To accomplish this, you can use either of the "hosts allow" or "hosts deny" directives. The line(s) should go in the block following the module name (in this case, somewhere after "[pub]"), and take the format:

    hosts allow = 192.168.0.0/24 This line would allow access from all hosts in the 192.168.0.x IP range, assuming they are properly authenticated by user/password, and block everyone else ("hosts deny" is not even necessary in this case, it's implicit that all other hosts are denied). The IP/hostname specifications can take multiple forms, which are described in more detail in "man rsyncd.conf".
    Optional: If you're creating multiple rsync modules, you may be pleased to know that any of the parameters from the module section above can be moved to the global section. For example, if the "uid" and "gid" parameters from the "pub" section are moved into the global section above, those two settings will apply to "pub" and any other rsync module that doesn't explicitly override the parameters.

  3. Create a file: "/etc/rsyncd.secrets", with the contents:
    pub:pub This simply makes a user pub, with password pub. Note that since this password is in plain text, the file MUST be owned by only root, and readable by only root (chmod 600 /etc/rsyncd.secrets). Otherwise, any local user/exploit may view the password, and rsync may not even start if the permissions are not correct.
  4. This step differs depending on which Linux distribution you use. For distributions that use the inetd "super-server" (such as Slackware), use the first subsection below. For those that use xinetd instead (such as Fedora), use the second subsection.

    1. Add to your: "/etc/inetd.conf":

      rsync stream tcp nowait root /usr/bin/rsync rsync --daemon Of course, you'll want to change the path to whatever is correct on your system, though /usr/bin/rsync should be the case for most.
    2. Many distros that use xinetd already include a "/etc/xinetd.d/rsync" file. If this is the case, you can simply edit the file and change:

      disable = yes to:

      disable = no If the file does not exist, create it, with the contents:
      service rsync
      {
      disable = no
      socket_type = stream
      wait = no
      user = root
      server = /usr/bin/rsync
      server_args = --daemon
      log_on_failure += USERID
      }

  5. Add to your: "/etc/services":
    rsync 873/tcp If your services file already lists the rsync port, you don't need to add this entry (duh). Also, you can change 873 to any other number if you want to run rsync on a non-standard port.
  6. Run "killall -HUP inetd" (or "killall -HUP xinetd", if applicable) as root, to restart the inetd/xinetd daemons. You can alternatively run "/etc/init.d/xinetd restart" if you prefer to restart xinetd that way. rsync should now be ready to listen on the specified port.


How to test your rsync setup:

  1. Run: "rsync rsync://pub@your-ip-or-hostname/". After entering your password (also pub), rsync should list the only available share, pub.
  2. Run: "rsync rsync://pub@your-ip-or-hostname/pub/". After entering your password, rsync should now give a file listing. If there are no files listed, place some files and directories in the directory and try again.
  3. Run: "rsync -v --progress --partial rsync://pub@your-ip-or-hostname/pub/someFile ." (you can abbreviate --partial --progress as -P). Your file should now be downloading.
  4. Run: "rsync -aPv rsync://pub@your-ip-or-hostname/pub/someDirectory .". Your directory should now be downloading.

Changelog:
2007-03-31, typo fix (thanks Karandeep Bains).
2007-01-07, Ranjit Singh suggested pointing out that module parameters are usable in the global section.
2006-04-01, Franz-Robert van Vugt suggested the alternate method of restarting xinetd.
2005-10-24, added xinetd info (thanks Jeff Silverman and S. Anbalagan), and information on allowing/denying certain IP addresses (suggested by Jeff), edited various minor portions (including testing section).
2004-12-17, added note about "nogroup" (thanks Michael Farrell).
2003-05-18, fixed spelling error (rsnycd.conf).
2002-10-14, updated config (logging).
[Chỉ có thành viên mới thấy links này. ] ©2009 [Chỉ có thành viên mới thấy links này. ]



Bài viết cùng chủ đề:
Chip vẫn chưa có mặt trong diễn đàn  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Trả Lời Với Trích Dẫn
Trả lời

Bookmarks


Ðang đọc: 1 (0 thành viên và 1 khách)
 
Ðiều Chỉnh Kiếm Trong Bài
Kiếm Trong Bài:

Kiếm Chi Tiết
Xếp Bài

Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt
Trackbacks are Mở
Pingbacks are Mở
Refbacks are Mở

Chuyển đến



Múi giờ GMT. Hiện tại là 12:37 AM.
Powered by: vBulletin - Copyright © 2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.AdminTalk.vn
Powered by vBCMS® 1.2.5 ©2002 - 2012 VinaCIS® Corporation