Article View: news.software.nntp
Article #81737Authentication for rsync over ssh failing
From: John F. Morse
Date: Tue, 04 Aug 2009 05:11
Date: Tue, 04 Aug 2009 05:11
87 lines
4041 bytes
4041 bytes
I'm trying to connect to and fetch INN status files from a remote news
server ("inn2") and make them available on apache.
I manually (remotely via an ssh BASH session) run an rsync copy from
/var/spool/news on an Apache Webserver ("apache").
I can't get it to work, and it must work before I can put the routine
into a cron job on apache to automate it.
Working only as user "news" on both computers, I have the proper keys
created ("ssh-keygen -t rsa") with no passphrase. The created id_rsa.pub
key was copied to "authorized_keys" and then scp'd to
/var/spool/news/.ssh/authorized_keys on inn2.
Then on the apache server I entered the following command:
news@apache:~/.ssh$ rsync -avvzn -e "ssh -i
/var/spool/news/.ssh/authorized_keys" news@inn2:/var/spool/news/testfile .
[That is a dot at the end of the command to signify user news' home
directory, where "testfile" resides.]
The following was reported on apache:
opening connection using: ssh -i /var/spool/news/.ssh/authorized_keys -l
news inn2 rsync --server --sender -vvnlogDtprze.iL .
/var/spool/news/testfile
A tail of /var/log/auth.log on inn2 shows the following:
Aug 3 22:39:36 inn2 sshd[947]: Authentication refused: bad ownership or
modes for directory /var/spool/news
Hmmmm.... More about this below.
Back in the ssh session on apache:
news@inn2's password:
[I manually enter the password]
The tail of /var/log/auth.log on inn2 shows the following:
Aug 3 22:40:59 inn2 sshd[947]: Accepted password for news from
xx.xx.xx.xx port 60008 ssh2
Aug 3 22:41:00 inn2 sshd[947]: pam_unix(sshd:session): session opened
for user news by (uid=0)
Back in the ssh session on apache, the following output indicates the
manual authentication works fine:
receiving incremental file list
delta-transmission enabled
testfile
total: matches=0 hash_hits=0 false_alarms=0 data=0
sent 14 bytes received 108 bytes 1.43 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)
news@apache:~/.ssh$
The tail of /var/log/auth.log on inn2 acknowledges:
Aug 3 22:41:00 inn2 sshd[947]: pam_unix(sshd:session): session closed
for user news
It works fine providing I manually enter a password. Of course that is
impossible to do with a cron job running in the middle of the night.
I also do not understand the report "Authentication refused: bad
ownership or modes for directory /var/spool/news" in the tail of the
auth.log of sshd on inn2. There are no improper ownerships nor
permissions. If there were, the manual authentication would fail.
It appears this is acting like the cart before the horse. IOW, it is
wanting read access to /var/log/news/.ssh/authorized_keys to determine
the encrypted password -- which is required to allow access to the same
directory and file!
Debian 5.0.1
OpenSSH_5.1p1 Debian-5, OpenSSL 0.9.8g 19 Oct 2007
rsync version 3.0.3 protocol version 30
I've fought this for the past three days, so any ideas will be appreciated.
--
John
Technical Details
Message-ID:
<h58ftm$ndc$1@optima5.xanadu-bbs.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!xlned.com!feeder3.xlned.com!news.glorb.com!news2.glorb.com!optima2.xanadu-bbs.net!optima5.xanadu-bbs.net!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <h58ftm$ndc$1@optima5.xanadu-bbs.net> Subject: Authentication for rsync over ssh failing Date: Tue, 04 Aug 2009 00:11:17 -0500 From: "John F. Morse" <john@example.invalid> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!xlned.com!feeder3.xlned.com!news.glorb.com!news2.glorb.com!optima2.xanadu-bbs.net!optima5.xanadu-bbs.net!not-for-mail Newsgroups: news.software.nntp Organization: Xanadu BBS Lines: 87 Reply-To: dont.bother Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: optima5.xanadu-bbs.net 1249362678 23980 192.168.89.210 (4 Aug 2009 X-Complaints-To: newsmaster@xanadu-bbs.net NNTP-Posting-Date: Tue, 4 Aug 2009 05:11:18 +0000 (UTC) User-Agent: Thunderbird 2.0.0.22 (X11/20090608) X-Enigmail-Version: 0.96.0