WinSCP chroot()
Preface : OK, this is sloppy but works. I'll need everyone's input for refinement so email me results and
also I'll need to send you david.tar.gz.
radnix@hotmail.com
This test performed on Linux RedHat 7.2 This procedure is a prototype. Sign in as root.
I._________________________________________________________________________________
SSH2 - download and install SSH Secure Shell 3.2 non-commercial :
<invalid link removed>
tar -xvpf ssh-3.2.0.tar.gz
cd ssh-3.2.0
./configure
make
install
note : Observe that new folder has been created
/etc/sshd2.
II.________________________________________________________________________________
USER FOLDER - to be SSH2 chrooted : example will assume user
paul in
/home/paul. He's using a bash shell.
Place
david.tar.gz in
/home folder,
tar -xzpf david.tar.gz. This example presumes that user
david does NOT exist.
Now folder
/home/david is created. Rename folder to be SSHD2 chrooted to it's name dot bak i.e.
paul.bak.
Rename
/home/david to
/home/name i.e.
/home/paul.
Observe ownerships of new user directory are
david, so change the folder and internal
david user/group to
paul,
That is, only the files/folders for renamed folder
paul from
david to
paul.
Edit
home/paul/etc/passwd – replace
david:x:656:507:david bosshardt:/home/david:/bin/bash with
paul's
/etc/passwd entry. Delete
david's line in
/home/paul/etc/passwd, copy
paul's line from
/etc/passwd and paste it in
/home/paul/etc/passwd.
Edit
home/paul/etc/group – replace
david:x:507: with
paul's
/etc/group entry. Delete
david's line in
/home/paul/etc/group, copy
paul's line from
/etc/group and paste it in
/home/paul/etc/group.
III._______________________________________________________________________________
CONFIG SSHD2, KILL SSHD, START SSHD2, RUN WinSCP :
Edit
/etc/sshd2/sshd2_config – Find line
ChRootUsers. Add
paul as
If you have
sshd running, kill it. Now, start SSHD2 by simply typing in
sshd. Remember, we're NOT running the old
sshd, we're going to run the new install
sshd2.
Now, from my window xp machine, I run WinSCP :
paul@xxx.xxx.xxx.xxx port 22
supply
paul's login name and password and I'm in. Pauls folder is chrooted and I appear to have full functionality of WinSCP.