Solved

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

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

749 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