LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-24-2014, 03:24 PM   #1
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Rep: Reputation: 30
passwordless rsync over ssh issue


I have setup rsync over ssh passwordless on all my computers. But this one computer running windows 7 and cwrsync works differently than my other windows 7 computers.

I am able to set it up so it can ssh into my server using the authorized_keys file. I set it to run my rsync script and it errors out.

authorized keys file looks like this:


command="rsync --server -vlogDtprze.iLsf . /media/backup/Bill/" ssh-rsa AAAAC5NzaC-etc

All my other computers run this same exact command. If I remove the authorized keys file and run my backup script from the windows 7 computer, a password to login is required. I am able to type in the password, press enter, and see the rsync script work perfectly.

So this leads me to believe it's on my end...but I'm just not sure where.

-Thanks for any ideas and help
 
Old 06-24-2014, 08:31 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,034

Rep: Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405
Hi,
Quote:
Originally Posted by xmrkite View Post
I have setup rsync over ssh passwordless on all my computers. But this one computer running windows 7 and cwrsync works differently than my other windows 7 computers.

I am able to set it up so it can ssh into my server using the authorized_keys file. I set it to run my rsync script and it errors out.
So what errors are reported?

Quote:
authorized keys file looks like this:


command="rsync --server -vlogDtprze.iLsf . /media/backup/Bill/" ssh-rsa AAAAC5NzaC-etc
What happens if you remove the command="...."? Can you ssh to that machine? If no, what errors are reported?
Quote:
All my other computers run this same exact command. If I remove the authorized keys file and run my backup script from the windows 7 computer, a password to login is required. I am able to type in the password, press enter, and see the rsync script work perfectly.


So this leads me to believe it's on my end...but I'm just not sure where.
You need to look at what both ssh and sshd are telling you. Do you have access to the logged output of sshd? I have no idea where that would be on a on windows, or even what implementation of sshd is used.

Evo2.
 
Old 06-24-2014, 09:14 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179
Things to do:
  • Carefully consult all available sources of information on both sides. The Windows Event Log Viewer administrative-tool probably has important clues. On OS/X this is called console. On Unix/Linux, files in /var/log.
  • Be sure that the content of all files, e.g. in the hidden .ssh directory, are exactly as they should be both with regard to content and permissions.
  • Don't "assume" anything ... prove it. Look at the content of the certificate-file that you're "sure" is the right one. (Tools like "md5sum" or "sha1sum" are handy to get "digests" that let you quickly compare files.)
  • Try to do an ssh connection with the -v command-line option ... specified 1 to 3 times to increase "verbosity."
  • Make certain that an "ssh-agent" program is running on the client-side. In Windows (Putty ...), this is probably "pageant" (pagent?).
 
Old 06-24-2014, 09:59 PM   #4
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
So I am able to log in without a password using the authorized_keys. So I know that it works. Also, I can log in and have the key file run a simple command like "ls" and it works.

The computer is back at my office so I will try again tomorrow and see if I can get any more info.
 
Old 06-24-2014, 10:08 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,034

Rep: Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405
Hi,
Quote:
Originally Posted by xmrkite View Post
So I am able to log in without a password using the authorized_keys. So I know that it works. Also, I can log in and have the key file run a simple command like "ls" and it works.
Sounds like it could be that rsync is not in the path. Again, it is likely the error message provides the information needed to know what is going on.

Cheers,

Evo2.
 
Old 06-25-2014, 01:03 PM   #6
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
Ok here is the auth.log info:

Jun 25 09:58:37 server sshd[3405]: Accepted publickey for Bill from 192.168.1.102 port 49968 ssh2: RSA 9d:----------hidden-------:c5
Jun 25 09:58:37 server sshd[3405]: pam_unix(sshd:session): session opened for user Bill by (uid=0)
Jun 25 09:58:37 server systemd-logind[508]: Removed session 3033.
Jun 25 09:58:37 server systemd-logind[508]: New session 3034 of user Bill.
Jun 25 09:58:37 server sshd[3405]: pam_unix(sshd:session): session closed for user Bill


And here is the error info from Windows:

sending incremental file list
rsync: writefd_unbuffered failed to write 4092 bytes to socked [sender]: Software caused connection abort <113>
rsync: connection unexpectedly closed <9 bytes received so far> [sender]
rsync error: error in rsync protocol data stream <code 12> at io.c<600> [sender=3.0.6]
 
Old 06-25-2014, 03:15 PM   #7
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
Well, I just deleted the account on the server and started over and got it working. No idea why it didn't work before.
 
  


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
Rsync password asked even after generating key (while ssh works passwordless) frsechet Linux - Server 46 02-06-2015 06:55 PM
passwordless SSH issue jindalarpan Linux - Server 14 10-09-2010 12:46 PM
rsync server backup through ssh tunnel issue vidhut Linux - Networking 1 01-06-2009 04:53 AM
rsync + ssh = backslash issue mrjamin Linux - Software 1 05-24-2006 03:16 AM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 01:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration