Solved

RSYNC over SSH to the DAEMON

Posted on 2004-08-04
12
697 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
[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
  • 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
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 

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
 
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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

623 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