RSYNC over SSH to the DAEMON

I want to RSYNC via SSH (for encryption only) to a remote server and use the Daemon to allow/grant access access to the modules using the normal auth users option.  

I am have tried the following syntax,
RSYNC -va -e ssh.exe auth_user@
RSYNC -v -e "ssh.exe ssh_user@" auth_user@

ssh.exe ssh_user@
works fine as I have the public/private keys setup.

Any ideas anyone? Is this possible?  Certainly likes it it from the manual but can't quite get it to work!

Who is Participating?

Improve company productivity with a Business Account.Sign Up

tkrabecConnect With a Mentor Commented:
this rsync -bavz *.* server::test/ did not do subdirectories

rsync -bavz /cygdrive/d server::test/ gets sub directories
rsync -bavz /cygdrive/d/ server::test/ gets sub directories  but does not make a d under test

-- Tim
I use ssh via cygwin on my xp box.

I use rsync -av -e ssh .
I have the username set via set USERNAME=ssh_user in the batch file before I use rsync
as well as
SET TERM = ansi
set HOME = c:\
set RSYNC_RSH=ssh.exe

Hope that helps
-- Tim
carillianAuthor Commented:
Hi Tim,

I can get RSYNC over SSH to work but I was wondering how I get RSYNC over SSH to the DAEMON to work properly.  I see bits of information around but cannot get it work.

My example,
rsync -av -e "ssh_user@"
keeps resulting in the error message
bash: line1 : : command not found

rsync -av works aboslutely fine

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Are you on linux or windows?
carillianAuthor Commented:
I'm on win xp running cygwin and need to transfer securely to linux red hat 9
ok I have a similar set up I run thru a batch file.

Do you wan tthe rsync user to login automatically?

I use rsync outside of the cygwin shell, and I strictly call rsync and ssh.

-- Tim
carillianAuthor Commented:
Okay, the aim is logon the user automatically and securely.

The daemon only is an issue because of the clear text passwords and non-encryption during transport issue.  We can wrap this up with stunnel but that comes with it's own stack of stuff.

I would like to use ssh for secure authentication and encrypted transport and the daemon to further authenticate and organise the rsync file access rather than give them shell access.

hope this makes sense, I have seen things about running across ssh to get to the daemon but cannot get it to work.

I hate to say it but I am now more confused.
Do you basically want to use rsync with ssh to back up files to a remote machine then have a Daemon(process)  put the files in to some kind of organized structure?

-- TIm
carillianAuthor Commented:
Okay, trying simply I want to use RSYNC over SSH but require the DAEMON still to control authentication, the website seems to explain this is possible but I cannot get it to work correctly.

a) rsync --rsh="ssh -l (ssh_user)"
correctly returns the list of available modules at the daemon

b) rsync -- rsh="ssh -l (ssh_user)" (daemon_user)@
should return the contents at that module but instead I get the following msg

@ERROR: chroot failed
rsync: connection unexpextedly closed (75 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(342)

I do not get any errors in my rsyncd.log, in fact I find nothing in the log at all!

Thanks Steve
It is sometimes useful to be able to set up file transfers using rsync server capabilities on the remote machine, while still using ssh or rsh for transport. This is especially useful when you want to connect to a remote machine via ssh (for encryption or to get through a firewall), but you still want to have access to the rsync server features (see RUNNING AN RSYNC SERVER OVER A REMOTE SHELL PROGRAM, below).

From the user's perspective, using rsync in this way is the same as using it to connect to an rsync server, except that you must explicitly set the remote shell program on the command line with --rsh=COMMAND. (Setting RSYNC_RSH in the environment will not turn on this functionality.)

In order to distinguish between the remote-shell user and the rsync server user, you can use '-l user' on your remote-shell command:

rsync -av --rsh="ssh -l ssh-user" rsync-user@host::module[/path] local-path
The "ssh-user" will be used at the ssh level; the "rsync-user" will be used to check against the rsyncd.conf on the remote host.
I went into /etc/xinetd.d and edited the rsync entry making sure it was enabled.  I went from getting error code 10 to error code 12
I aslo use the command rsync user@dom:: --verbose --verbose it has given me a little more information.  Hope this ehelps some I will look at getting you more info soon

-- Tim
I think I have found the answer.  I got rsync set up on my windows server(s) both as client and server
I used cwrsync(a cywgin port of just rsync)
I added modules in the rsyncd.conf file with the following format
path = /cygdrive/d/data
read only = false
transfer logging = yes
path = /cygdrive/d/data2
read only = false
transfer logging = yes

then when I type in the command rsync server::
I saw the above modules

to sync to them I used rsync -bavz *.* server::test/

and it worked beautifully

-- Tim
carillianAuthor Commented:
this did not really solve the question
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.