LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-26-2006, 04:33 PM   #1
cuschu
Member
 
Registered: Jun 2005
Location: Lander, Wyoming
Distribution: Ubuntu 9.05 LTSP Server, Kubuntu 9.04 Desktop
Posts: 46

Rep: Reputation: 15
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]
    path = /home/cuschu/backup
    comment = My backup folder
    uid = cuschu
    gid = users
    read only = false
    auth users = cuschu
    secrets file = /etc/rsyncd.conf.secrets
I installed cygwin in order to run rsync and this is what I get

Code:
$ rsync 192.168.1.105::backup
rsync: failed to connect to 192.168.1.105: Connection refused (111)
rsync error: error in socket IO (code 10) at /home/lapo/packaging/tmp/rsync-2.6.
6/clientserver.c(98)
I know my server resides at 192.168.1.105, but I have no idea how to configure the firewall. The error message looks like the ubuntu firewall is blocking my request to backup. How do I configure the firewall to open up port 111?
 
Old 08-27-2006, 09:44 AM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
Are you sure that your rsync server is actually running on your linux box?
 
Old 08-27-2006, 06:30 PM   #3
cuschu
Member
 
Registered: Jun 2005
Location: Lander, Wyoming
Distribution: Ubuntu 9.05 LTSP Server, Kubuntu 9.04 Desktop
Posts: 46

Original Poster
Rep: Reputation: 15
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.
 
Old 08-28-2006, 02:01 AM   #4
cuschu
Member
 
Registered: Jun 2005
Location: Lander, Wyoming
Distribution: Ubuntu 9.05 LTSP Server, Kubuntu 9.04 Desktop
Posts: 46

Original Poster
Rep: Reputation: 15
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
You could use another user besides root, but I have not added that to the rsyncd.conf, yet.
 
Old 08-28-2006, 02:09 AM   #5
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
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.
 
Old 08-28-2006, 07:11 PM   #6
cuschu
Member
 
Registered: Jun 2005
Location: Lander, Wyoming
Distribution: Ubuntu 9.05 LTSP Server, Kubuntu 9.04 Desktop
Posts: 46

Original Poster
Rep: Reputation: 15
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.
 
Old 08-29-2006, 02:49 AM   #7
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
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.
 
Old 10-21-2008, 08:19 AM   #8
rynodp
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
firewall

just open the related ports on your firewall
 
Old 10-21-2008, 09:41 AM   #9
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
The command to see what firewall rules are used on a linux box (itself) is:

Code:
iptables -L
That might print just a few lines or it might spit pages. If you have many rules, you'll want to pipe the output either to a file or into the less or more command to only show one screen at a time -

Code:
iptables -L > /tmp/fiirewall    (then read /tmp/firewall)
OR
iptables -L | less
iptables -L | more
Also, for future reference, it would help new users (or people new to rsync) to point out that the command you listed above:

Code:
rsync -e ssh -av --delete "/cygdrive/c/Documents" root@server:/backups
is run on the cygwin (windows) machine, not the server. As I read through the thread, I saw you trying to connect from the Ubuntu box to the Ubuntu box in the beginning, and never saw how you got data from the win box to Ubuntu. Also, it looks like your command would only backup the c:\Documents folder, which is fine if you have a c:\Documents folder. Most of the time, I think windows puts things like My Documents in c:\Documents and Settings?

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
 
Old 03-23-2010, 03:42 PM   #10
marxiano533
LQ Newbie
 
Registered: Jun 2006
Posts: 2

Rep: Reputation: 0
I had this problem and solved it seting the permissions of the password file to 700.
Hope this helps you.
Regards
 
Old 07-30-2012, 11:50 AM   #11
ranjithnada
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Rep: Reputation: Disabled
Lightbulb

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

Last edited by ranjithnada; 07-30-2012 at 11:52 AM.
 
Old 06-29-2013, 03:04 PM   #12
kzutter
Member
 
Registered: Nov 2007
Location: Carson City, NV USA
Distribution: Various, but always Debian based
Posts: 70

Rep: Reputation: 15
Smile 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!
 
Old 06-29-2013, 05:17 PM   #13
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,701

Rep: Reputation: 513Reputation: 513Reputation: 513Reputation: 513Reputation: 513Reputation: 513
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.
 
Old 07-01-2013, 12:23 PM   #14
kzutter
Member
 
Registered: Nov 2007
Location: Carson City, NV USA
Distribution: Various, but always Debian based
Posts: 70

Rep: Reputation: 15
Many ways to skin a cat - this is mine...

Quote:
Originally Posted by lleb View Post
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.
1. Running rsync on Win is not a "fight".
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????
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
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 On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ircd.conf: "Connection failed. Error: Connection refused" hamish Linux - Software 3 03-10-2005 08:23 AM
Apache "Connection was refused" remote access error spicychicken Linux - Newbie 7 02-11-2005 01:14 PM
RSync genrates error "connection refused" jacquedp Linux - Software 3 07-28-2004 04:52 AM
service named error "rndc: conenct failed: connection refused" Reu Linux - General 1 07-12-2004 02:34 PM
Synaptic Error: connection to":0.0" refused by server xsis4me Linux - Software 2 11-18-2003 08:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration