Solved

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
AWS EC2 Linux 1 38
Apache,  not running php on top level 14 54
Linux operating system 12 66
Anti-Spam SMTP Proxy Server (@SSP) 7 48
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.…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

744 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

15 Experts available now in Live!

Get 1:1 Help Now