LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2005, 02:57 PM   #1
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
rsync & scponlyc shell: not working


hello

I'm trying to do rsync over ssh. My users use the scponlyc shell (which chroots them into their home directory.

If the user has a shell like /bin/bash then the rsync works perfectly.

However, when their shell is scponlyc, then the rsync doesn't work:

Quote:
root@pi testuser # rsync -e ssh -vvvvvv -alnz /tmp/ testuser@mercury.iskm.com:/iskm/data/testuser/test/
cmd=ssh machine=mercury.iskm.com user=testuser path=/iskm/data/testuser/test/
cmd=ssh -l testuser mercury.iskm.com rsync --server -vvvvvvnlogDtprz . /iskm/data/testuser/test/
opening connection using ssh -l testuser mercury.iskm.com rsync --server -vvvvvvnlogDtprz . /iskm/data/testuser/test/
testuser@mercury.iskm.com's password:
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
_exit_cleanup(code=12, file=io.c, line=359): entered
rsync error: error in rsync protocol data stream (code 12) at io.c(359)
_exit_cleanup(code=12, file=io.c, line=359): about to call exit(12)
the log below shows that the rsync daemon DID recognise the rsync request.:
Quote:
Mar 5 20:52:35 pi [30878]: running: /usr/bin/rsync --server -vvvvvvnlogDtprz . /iskm/data/testuser/test/ (username: testuser(1020), IP/port: 10.0.0.1 59188 22)
Mar 5 20:52:35 pi [30878]: failed: /usr/bin/rsync --server -vvvvvvnlogDtprz . /iskm/data/testuser/test/ with error No such file or directory(2) (username: testuser(1020), IP/port: 10.0.0.1 59188 22)
What could the problem be? The chrooted environment has the binaries which it should need:
Quote:
root@pi testuser # lsl bin/
total 436K
-rwxr-xr-x 1 root root 50K Mar 15 2004 busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 chgrp -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 chmod -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 chown -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 echo -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 groups -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 id -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 ln -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 ls -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 mkdir -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 mv -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 pwd -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 rm -> busybox
lrwxrwxrwx 1 root root 7 Mar 5 10:15 rmdir -> busybox
-rwxr-xr-x 1 root root 219K Mar 5 20:45 rsync
-rwxr-xr-x 1 root root 56K Mar 15 2004 scp
-rwxr-xr-x 1 root root 92K Mar 15 2004 sftp-server
does anyone have any suggestions as to the cause of this problem?

Many thanks
hamish
 
Old 03-05-2005, 03:53 PM   #2
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Original Poster
Rep: Reputation: 30
Hey

I didn't get scponlyc working, instead I just used the regular jail/chrooted environment. This is probably more specific to the problem.



Hamish
 
Old 05-27-2005, 12:10 PM   #3
imknight
LQ Newbie
 
Registered: May 2005
Posts: 1

Rep: Reputation: 0
Dont know if you found the answer to this but i just had the same issue and got round it.

You need to copy rsync into the chroot i put it in bin/ (the same as in your post i just noticed now)

Then specify the path to it such as this:

rsync -av --rsync-path=/bin/rsync USER@DOMAIN:REMOTEPATH LOCALPATH

Last edited by imknight; 05-27-2005 at 12:12 PM.
 
Old 05-28-2005, 07:15 AM   #4
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Original Poster
Rep: Reputation: 30
Hey

got it fixed.

the solution was really obvious and I should have noticed. Once i has set the user to be jailed in home directory using scponlyc, the users home directory become "/" (ie the root partition), and not "/home/user"

Thus, the remote path is alwasy /

sorry, I should have posted this earlier.

hamish
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
local rsync shell script eradrix Programming 13 07-09-2005 12:57 AM
setting up sftp with scpjailer, scponlyc disorderly Linux - Software 1 06-08-2005 10:26 PM
shell script + change shell && continue darkRoom Programming 6 02-25-2005 02:50 AM
Tightening shell accounts? SSH & RSync gian2oo1 Slackware 2 01-07-2005 02:15 PM
rsync & acl collen Linux - Software 0 12-10-2003 09:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration