Solved

Is it possible to use RSYNC with PLINK.EXE(PUTTY) as Remote shell?

Posted on 2004-08-04
3
3,061 Views
Last Modified: 2013-12-15
I would like to automate backups from win32 cygwin environment to a linux backup server with rsync.
I can use rsync -e ssh but always get asked for a password (needs to be automated).
plink.exe has the option -pw to pass the password but I cannot get this to work in conjunction with the RSYNC -e remote shell option.

I have tried the following,

>rsync -e plink username@1.2.3.4:\
Access denied
Access denied
FATAL ERROR: Server sent disconnect message
type 2(SSH_DISCONNECT_PROTOCOL_ERROR):
"Too many authentication failures for username"
rsync:read error:Connection reset by peer
rsync error: error in resync protocol data stream (code 12) at io.c(354)

>rsync -e "plink 1.2.3.4 -l username -pw password" username@1.2.3.4:\
bash: line 1: 1.2.3.4: command not found
rsync: read error: Connection reset by peer
rsync error: error in resync protocol data stream (code 12) at io.c(354)

BUT the following works fine using ssh as the transport
>rsync -e ssh username@1.2.3.4:\

0
Comment
Question by:carillian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Expert Comment

by:pYrania
ID: 11714336
enable id-based authentification.

http://mah.everybody.org/docs/ssh
0
 

Author Comment

by:carillian
ID: 11715448
I want to pipe a password into rsync using a VB app - do not want to really leave private keys lying around for people to wander off with.

Anyone tried PLINK ? I need RSYNC functionality.
0
 
LVL 2

Accepted Solution

by:
kevincasey earned 500 total points
ID: 11973415
i use plink and pageant for cvs access to a linux machine, and i image the setup is similar.

1) create a public/private keyset using puttygen.exe.  you're right, you don't want to leave the keys lying around - so put them into a folder where only the user running the program has read access

2) setup a profile using putty.exe so that you can login using the keys created above (you'll probably have to copy/paste the public key to your server, too)

3) start pageant with the file path to your private key as an argument (e.g pageant.exe "c:\documents and settings\operator\my documents\etc")

4) now whenever plink.exe is invoked pageant will pass on the appropriate key

keysets with the appropriate permissions are the foundation of public key cryptography.  i'm guessing the vb app would just be a wrapper that writes the password to standard out - which is not very secure at all.
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question