LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   passwordless rsync over ssh issue (https://www.linuxquestions.org/questions/linux-software-2/passwordless-rsync-over-ssh-issue-4175509049/)

xmrkite 06-24-2014 02:24 PM

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

evo2 06-24-2014 07:31 PM

Hi,
Quote:

Originally Posted by xmrkite (Post 5193282)
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.

sundialsvcs 06-24-2014 08:14 PM

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?).

xmrkite 06-24-2014 08:59 PM

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.

evo2 06-24-2014 09:08 PM

Hi,
Quote:

Originally Posted by xmrkite (Post 5193438)
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.

xmrkite 06-25-2014 12:03 PM

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]

xmrkite 06-25-2014 02:15 PM

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


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