LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-06-2005, 08:40 PM   #1
Chrax
Member
 
Registered: Apr 2004
Distribution: Dapper
Posts: 167

Rep: Reputation: 31
rsync authentication


Hi, I'm running an rsync server, and I want to add user authentication. Can anybody explain to me how to do it, because I seem to be doing something wrong.

Here is the module in rsyncd.conf:

Code:
[chris]
        path = /share/chris
        comment = chris' files
        uid = chris
        gid = chris
        auth users = chris
        secrets file = /etc/rsyncd.secrets
Here's my rsync.secrets file:

Code:
chris:hello
So I run
Code:
$ rsync -Cavz chris@localhost::chris/home

Password: hello
@ERROR: auth failed on module chris
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)
Note that all of this works if I comment out the auth users line in the rsyncd.conf.

So does anybody see what I'm doing wrong?
 
Old 09-06-2005, 09:12 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
First off, make sure they're both either rsync.secrets or rsyncd.secrets... you call it by both names here. Could be a typo, could be the root cause of the problem. Secondly, make sure the file is terminated by a newline character.
 
Old 09-06-2005, 09:17 PM   #3
Chrax
Member
 
Registered: Apr 2004
Distribution: Dapper
Posts: 167

Original Poster
Rep: Reputation: 31
Yeah, it was just a typo.

And yes, the file is terminated with a newline.
 
Old 09-06-2005, 09:50 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
What are the permissions on the file?
 
Old 09-06-2005, 10:29 PM   #5
Chrax
Member
 
Registered: Apr 2004
Distribution: Dapper
Posts: 167

Original Poster
Rep: Reputation: 31
Hi. I know a lot of people here don't know what they're doing, but I know how to get around and debug most basic Unix problems. Please assume that I've checked the obvious things. What I actually need is someone who's used rsync with authentication, and I need them to tell me if there's anything wrong with my configuration or if they had any similar troubles and how they resolved them.

If it helps, I'm running Ubuntu Hoary Hedgehog and the standard rsync package.

That said,

Code:
$ ls -l /etc/rsyncd.secrets
-rw-r--r--  1 root root 24 2005-09-06 21:17 /etc/rsyncd.secrets
 
Old 09-06-2005, 10:34 PM   #6
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
I hope you didn't feel I was trying to treat you stupidly or anything like that. It *IS* hard to tell sometimes whether a user has checked those things.

Ironically enough, your problem is in the secrets file permissions. If the file is readable by 'others', then rsync will disallow access unless you have "strict modes" set to false. From the rsyncd.conf man page:
Quote:
There is no default for the "secrets file" option, you must
choose a name (such as /etc/rsyncd.secrets). The file must nor-
mally not be readable by "other"; see "strict modes".


strict modes
The "strict modes" option determines whether or not the permis-
sions on the secrets file will be checked. If "strict modes" is
true, then the secrets file must not be readable by any user id
other than the one that the rsync daemon is running under. If
"strict modes" is false, the check is not performed. The
default is true. This option was added to accommodate rsync
running on the Windows operating system.
Let me know how it goes.
 
Old 09-06-2005, 11:05 PM   #7
Chrax
Member
 
Registered: Apr 2004
Distribution: Dapper
Posts: 167

Original Poster
Rep: Reputation: 31
Good call. I had read that, but I missed the part where it said the default was true. That was the problem.

Thanks. It's always nice to have someone say "Stop being stupid and read".

And I know it's hard to tell whether or not someone knows what they're doing. My solution typically is to ask all the simple questions in one go to jog their memory. I just get tired of the back and forth of one obvious question, one obvious answer.
 
Old 09-07-2005, 07:19 AM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
I probably should've done that in the first place, but I hadn't gone back to look at the rsyncd.conf man page yet. I'm glad it worked out for you.
 
  


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
Authentication service cannot retrieve authentication info Moffett67 Linux - Software 3 12-13-2007 03:16 AM
When i run rsync and updatedb: get LDAP authentication error topcat Linux - Software 1 11-21-2004 02:45 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
Rsync help tricky1234 Solaris / OpenSolaris 3 09-07-2004 10:08 AM
rsync becks.lin Linux - Software 6 03-22-2004 07:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:51 AM.

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
Open Source Consulting | Domain Registration