rsync error "connection refused"
I am using Ubuntu server, no GUI, and I would like ot have rsync running to backup my Windows laptop. I have installed rsync and created the rsyncd.conf file
Code:
[backup] Code:
$ rsync 192.168.1.105::backup |
Are you sure that your rsync server is actually running on your linux box?
|
I think that it is but I am not sure, as I am rather new to linux. How do I check if it is running? Also, is it possible that I have only installed the rsync client, not the server. How do I check that? When I apt-get rsync it says that I have the newest version.
|
apt-get install rsync must work for the server side because I finally got it to sync. I could not figure out how to open another port. However, I found that if you go through ssh, it is more secure and the firewall will be a little easier to work with. Anyway, after the rsync.conf is set up and cygwin is loaded on the windows side here is the line that will make it back up (for future reference).
Code:
rsync -e ssh -av --delete "/cygdrive/c/Documents" root@server:/backups |
ssh will slow it down as well, and requires you to have a password or a certificate. You need to decide if the security is needed, i.e. if you are on a secure network or not. But it's certainly a good habit to use ssh whereever possible.
From the point of view of the firewall, ssh and rsync have the same level of complexity: one port to open (ssh:22 rsync:873). It's good that you've got it running, but it might still be useful to try the native rsync protocol as well, if only to find out why it didn't work in the first place. |
This is just on my home LAN, so security through ssh is probably overkill. However, when Ubuntu Server is installed SSH port 22 is already open and functioning. However, I could not get port 873 to open up, any ideas on how to open it? I could figure it out through a GUI, but I did not install one on this server.
|
I must admit I'm lazy and always use Guarddog as a firewall. Without GUI, you'll have to tinker with the iptables command. I am not at a Linux box now but I remember that iptables has a list command (try `man iptables`) which shows the rules. If you post them, we can go further.
|
firewall
just open the related ports on your firewall
|
The command to see what firewall rules are used on a linux box (itself) is:
Code:
iptables -L Code:
iptables -L > /tmp/fiirewall (then read /tmp/firewall) Code:
rsync -e ssh -av --delete "/cygdrive/c/Documents" root@server:/backups When backing up windows servers to linux boxes, I have found it easier to use rsyncd on the windows box. I do it on the LAN, so I have no need of encrypting the traffic, which is the big benefit of using ssh. If the data ever touches the internet, you are far better with ssh+rsync than rsyncd. There are opensource ports of rsyncd packages available for windows, both as batch files, services, and I've even seen and used a GUI program that runs an rsync server on windows. Peace, JimBass |
I had this problem and solved it seting the permissions of the password file to 700.
Hope this helps you. Regards |
I've had this exact same error and i resolved it using ubuntu rsync community page. I was missing the configuration of the rsync Daemon.
From the Ubuntu community rsync help page 1. Edit the file /etc/default/rsync to start rsync as daemon using xinetd. The entry listed below, should be changed from false to inetd. RSYNC_ENABLE=inetd 2. Install xinetd because it's not installed by default. $ sudo apt-get -y install xinetd 3. Create the file /etc/xinetd.d/rsync to launch rsync via xinetd. It should contain the following lines of text. service rsync { disable = no socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID flags = IPv6 } 4. Create the file /etc/rsyncd.conf configuration for rsync in daemon mode. The file should contain the following. In the file, user should be replaced with the name of user on the remote machine being logged into. max connections = 2 log file = /var/log/rsync.log timeout = 300 [share] comment = Public Share path = /home/share read only = no list = yes uid = nobody gid = nogroup auth users = user secrets file = /etc/rsyncd.secrets 5. Create /etc/rsyncd.secrets for user's password. User should be the same as above, with password the one used to log into the remote machine as the indicated user. $ sudo vim /etc/rsyncd.secrets user:userpassword 6. This step sets the file permissions for rsyncd.secrets. $ sudo chmod 600 /etc/rsyncd.secrets 7. Start/Restart xinetd $ sudo /etc/init.d/xinetd restart It worked for me hope this helps |
No need for xinetd
Rsync is disabled by default.
Edit /etc/default/rsync and change the line RSYNC_ENABLE=true and restart the daemon sudo service rsync restart And you are good to go! |
just a side note question: why not mount the windows directories via SAMBA or as a cifs mount point and use rsync on your Ubuntu server instead of fighting with trying to force rsync to run inside MS Windows. run it native on the Ubuntu box with much less hassle.
|
Many ways to skin a cat - this is mine...
Quote:
2. Local business security rules may prevent sharing folders on local machines. 3. Volume Shadow Copy cannot be done from the Linux side 4. Can schedule from the local side when convenient for local resources. 5. Should I continue???? |
All times are GMT -5. The time now is 12:00 AM. |