Re: Problem with use rssh
Brought to you by:
xystrus
From: Derek M. <co...@pi...> - 2004-04-04 04:15:20
|
On Fri, Apr 02, 2004 at 12:21:47PM +0200, lpi...@ka... wrote: > Hi all, Hi! > I try to compile, configure and use rssh. I read CHROOT files and > configure my system. Well, you have at least one obvious (to me) mistake. Depending on what distro you have, there may be others. > I configure /usr/local/etc/rssh file > What do I change? > 1. Uncommented > allowscp > allowsftp > 2. Change line: > chrootpath="/usr/sbin/chroot /usr/chroot/" This is wrong. The chrootpath line should contain ONLY the path to the directory you will use as your chroot jail. You have the path to the chroot binary here. The chroot binary is 100% irrelevant to rssh. With what you have, rssh is trying to chroot to the directory "/usr/sbin/chroot /usr/chroot/", which almost certainly doesn't exist. Based on what you wrote after this, it should read as follows: chrootpath="/usr/chroot/" > 1. Create new user test. In /etc/passwd I have line: > test:x:1010:1010:,,,:/usr/chroot:/usr/local/bin/rssh > 2. mkdir /usr/chroot > 3. mkdir /usr/chroot/lib /usr/chroot/etc/ /usr/chroot/local/bin/ > 4. cp -r /lib/* /usr/chroot/ > 5. cp /usr/bin/scp /usr/chroot/usr/bin/scp > 6. cp /usr/bin/sftp-server /usr/chroot/usr/bin/sftp-server > 7. cp /usr/local/bin/rssh /usr/chroot/usr/local/bin/rssh > 8. cp /usr/local/etc/rssh /usr/chroot/usr/local/etc/rssh > 9. cp /etc/ld* /usr/chroot/etc/ > 10. cp /etc/passwd /usr/chroot/etc/ > 11. cp -r /etc/ssh* /usr/chroot/ > 12. cp /usr/lib/lib* /usr/chroot/usr/lib/ If you're using Red Hat, I'm pretty sure there's at least one necessary library which is not in either /lib or /usr/lib. Be sure to use the ldd command, as mentioned in the CHROOT file, to figure out exactly what libraries you need. Also, your step #11 should be unnecessary. SSHD reads the files it needs in /etc/ssh long before rssh gets involved. Derek -- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0x81CFE75D |