RSYNC over SSH to the DAEMON

Hi
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@1.2.3.4::module_name
and
RSYNC -v -e "ssh.exe ssh_user@1.2.3.4" auth_user@1.2.3.4::module_name

but,
ssh.exe ssh_user@1.2.3.4
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!

Thanks
 
carillianAsked:
Who is Participating?
 
tkrabecConnect With a Mentor Commented:
this rsync -bavz *.* server::test/ did not do subdirectories

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

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

I use rsync -av -e ssh . server.com:backup
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
0
 
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@1.2.3.4" 1.2.3.4::
keeps resulting in the error message
bash: line1 : 1.2.3.4 : command not found

however,
rsync -av 1.2.3.4:: works aboslutely fine

Steve
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
tkrabecCommented:
Are you on linux or windows?
0
 
carillianAuthor Commented:
I'm on win xp running cygwin and need to transfer securely to linux red hat 9
0
 
tkrabecCommented:
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
0
 
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.

Steve
0
 
tkrabecCommented:
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
0
 
carillianAuthor Commented:
Okay, trying simply I want to use RSYNC over SSH but require the DAEMON still to control authentication, the website http://samba.anu.edu.au/ftp/rsync/rsync.html seems to explain this is possible but I cannot get it to work correctly.

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

b) rsync -- rsh="ssh -l (ssh_user)" (daemon_user)@1.2.3.4::(module)/
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



http://samba.anu.edu.au/ftp/rsync/rsync.html
----------------------------------------------------------------------------------------------------------------------------
CONNECTING TO AN RSYNC SERVER OVER A REMOTE SHELL PROGRAM
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.
----------------------------------------------------------------------------------------------------------------------------------------
0
 
tkrabecCommented:
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
0
 
tkrabecCommented:
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
[test]
path = /cygdrive/d/data
read only = false
transfer logging = yes
[test2]
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
0
 
carillianAuthor Commented:
this did not really solve the question
0
All Courses

From novice to tech pro — start learning today.