Solved

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

Posted on 2004-08-04
3
2,898 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
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now