LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to rsync over ssh from Windows to Linux (http://www.linuxquestions.org/questions/linux-networking-3/how-to-rsync-over-ssh-from-windows-to-linux-441868/)

hareeshvv 05-05-2006 08:30 AM

How to rsync over ssh from Windows to Linux
 
Hi everybody,
I am new to LQ...
I am having a problem related with rsync between Windows and linux
i have installed cygwin in WinXP machines.Generated ssh rsa key fas the user "abc" and appended it to authorized_keys file in my Linux server.
I can ssh to Linux from Win XP without password through Putty
But I can't use the ssh-rsa key along with rsync

I tried rsync -avz -e ssh somedir 192.168.0.x:/some/dir
But it doesn't work
It prompts as "Enter Passphrase

At this moment I am logged in as "abc'
i also tried adding the usr "abc" in Linux and
chown abc.abc /some/dir

Any idea
Thanks in advance

mackdav 05-06-2006 10:36 AM

What rsync are you using? If you are using the cygwin one, it is best to install a complete cygwin environment and set up ssh and rsync inside that; I had similar problems getting the stand-alone version to work. The only downside of doing it this way is that cygwin is painfully slow.

hareeshvv 05-08-2006 04:58 AM

Thanks for ur reply
I wil try it
I am using cygwin_2.0.5 and the problem is that of the rsa key
That is I can't use the key along with rsync command

BrianK 05-08-2006 07:01 PM

have you ever managed to get public key authentication working on the linux server? in other words, can you ssh into the linux server from any machine without entering a password?

I ask because permissions on the .ssh directory are very important. What are the permissions on the .ssh directory and the authorized keys file on the linux server?

Also, I assume that you're rsyncing as a specific user on the linux box, i.e.

rsync -avz -e ssh foo abc@192.168.0.500:/bar

if you don't include the "abc@", then it will use whatever user you're logged in as in cygwin (the username returned by `whoami`). If you're abc on both machines, then the public key on the cygwin side must be in that user's auth_keys file.... anda again, permissions *must* be correct.

yull 05-10-2006 03:13 AM

Hi

Quote:

I tried rsync -avz -e ssh somedir 192.168.0.x:/some/dir
But it doesn't work
It prompts as "Enter Passphrase
when you've build you're public keys, you've been esked for a passphrase.

You should have pressed enter without specifying a passphrase, this way you should be able to ssh from windows to linux without password or anything.

At least this is how I've done and it works.

hareeshvv 05-10-2006 06:52 AM

Quote:

Originally Posted by BrianK
have you ever managed to get public key authentication working on the linux server? in other words, can you ssh into the linux server from any machine without entering a password?

I ask because permissions on the .ssh directory are very important. What are the permissions on the .ssh directory and the authorized keys file on the linux server?

Also, I assume that you're rsyncing as a specific user on the linux box, i.e.

rsync -avz -e ssh foo abc@192.168.0.500:/bar

if you don't include the "abc@", then it will use whatever user you're logged in as in cygwin (the username returned by `whoami`). If you're abc on both machines, then the public key on the cygwin side must be in that user's auth_keys file.... anda again, permissions *must* be correct.

Brian,
I tried it after changing permission to 777 for all those items you mentioned.
But still the problem remains the same.
I just generated public key for user "abc" from my Win XP and exported it to Linux.I am able to ssh through putty without any password.
But it doesn't work with "ssh.exe" that comes along with Cygwin

hareeshvv 05-10-2006 06:53 AM

Hi yull,
All that I done is same as you specified.I didn't enter any pasphrase

yull 05-10-2006 07:19 AM

If he asks your for a passphrase, when you did not sepify a passphrase when you generated te public keys, that means your linux box doesn't find the authorized_keys for 'abc'

check
- append 'abc@yourip' when using ssh or rsync
- check if the file authorised_keys belongs to user abc:abc
- is this file in /home/abc/.ssh/ (home dir as specified in /etc/password)
- check rights of .ssh (rwx at least for 'abc')

it has to wrk, I set up the same thing yesterday successfully that way...

BrianK 07-06-2006 10:11 PM

Quote:

Originally Posted by hareeshvv
Brian,
I tried it after changing permission to 777 for all those items you mentioned.
But still the problem remains the same.
I just generated public key for user "abc" from my Win XP and exported it to Linux.I am able to ssh through putty without any password.
But it doesn't work with "ssh.exe" that comes along with Cygwin

I know this thread is old, but in case anyone else comes across it looking for answers, 777 is the exact wrong permissions... permissions on the keys are very sensitive - 777 lets the world see (and edit, for that matter) your keys & ssh is smart enough to not allow for that. the .ssh dir on both machines should be 700, or, u+rwx go-rwx; the auth_keys file should be 600.


All times are GMT -5. The time now is 01:55 AM.