Solved

RSYNC over SSH to the DAEMON

Posted on 2004-08-04
12
671 Views
Last Modified: 2013-12-06
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
 
0
Comment
Question by:carillian
  • 7
  • 5
12 Comments
 
LVL 1

Expert Comment

by:tkrabec
ID: 11716649
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
 

Author Comment

by:carillian
ID: 11716883
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
 
LVL 1

Expert Comment

by:tkrabec
ID: 11716966
Are you on linux or windows?
0
 

Author Comment

by:carillian
ID: 11717285
I'm on win xp running cygwin and need to transfer securely to linux red hat 9
0
 
LVL 1

Expert Comment

by:tkrabec
ID: 11717327
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
 

Author Comment

by:carillian
ID: 11717742
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Expert Comment

by:tkrabec
ID: 11717921
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
 

Author Comment

by:carillian
ID: 11727064
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
 
LVL 1

Expert Comment

by:tkrabec
ID: 11727572
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
 
LVL 1

Expert Comment

by:tkrabec
ID: 11824205
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
 
LVL 1

Accepted Solution

by:
tkrabec earned 500 total points
ID: 11824271
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
 

Author Comment

by:carillian
ID: 12288712
this did not really solve the question
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

12 Experts available now in Live!

Get 1:1 Help Now