LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 05-05-2006, 08:30 AM   #1
hareeshvv
Registered User
 
Registered: Apr 2006
Location: India
Distribution: RedHat
Posts: 6

Rep: Reputation: 0
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
 
Old 05-06-2006, 10:36 AM   #2
mackdav
Member
 
Registered: Feb 2005
Distribution: RHEL, CentOS
Posts: 113

Rep: Reputation: 16
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.
 
Old 05-08-2006, 04:58 AM   #3
hareeshvv
Registered User
 
Registered: Apr 2006
Location: India
Distribution: RedHat
Posts: 6

Original Poster
Rep: Reputation: 0
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
 
Old 05-08-2006, 07:01 PM   #4
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
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.
 
Old 05-10-2006, 03:13 AM   #5
yull
Member
 
Registered: Dec 2004
Location: Belgium
Distribution: debian
Posts: 48

Rep: Reputation: 15
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.
 
Old 05-10-2006, 06:52 AM   #6
hareeshvv
Registered User
 
Registered: Apr 2006
Location: India
Distribution: RedHat
Posts: 6

Original Poster
Rep: Reputation: 0
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
 
Old 05-10-2006, 06:53 AM   #7
hareeshvv
Registered User
 
Registered: Apr 2006
Location: India
Distribution: RedHat
Posts: 6

Original Poster
Rep: Reputation: 0
Hi yull,
All that I done is same as you specified.I didn't enter any pasphrase
 
Old 05-10-2006, 07:19 AM   #8
yull
Member
 
Registered: Dec 2004
Location: Belgium
Distribution: debian
Posts: 48

Rep: Reputation: 15
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...
 
Old 07-06-2006, 10:11 PM   #9
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
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.
 
  


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
windows sceduler and rsync over ssh: need help please hamish Linux - Networking 3 03-27-2007 02:26 PM
Rsync Backup From Windows To Linux Problem sectrean Linux - Networking 0 10-18-2004 04:11 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
Linux Server backuping Windows machine over Rsync? browny_amiga Linux - General 7 06-23-2004 10:13 AM


All times are GMT -5. The time now is 09:08 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration