Env :
SSH : 4.3p2
Linux : RHEL 5.5
Kernel : 2.6.18-194.32.1.el5
Arch : 64 bit
BE VERY CAREFUL BEFORE DOING THIS :
Here is what I did :
On SSH server :
1. Add the following in /etc/ssh/sshd_config
ChrootDirectory /test
2.
# mkdir /test
# cd /test; mkdir bin lib64 [ on 32 bit server create 'lib' instead of lib64 ]
# cp /bin/bash /test/bin
# ldd /bin/bash
libtermcap.so.2 => /lib64/libtermcap.so.2 (0x000000387f800000)
libdl.so.2 => /lib64/libdl.so.2 (0x000000387fc00000)
libc.so.6 => /lib64/libc.so.6 (0x000000387f400000)
/lib64/ld-linux-x86-64.so.2 (0x000000387f000000)
Then copy all libraries under /lib64 to /test/lib64/ [ for example # cp /lib64/libtermcap.so.2 /test/lib64/ ]
3. If customer want to use 'ls' command in chrooted environment, repeat the same steps for ls too.
4. Restart sshd server like : /etc/init.d/sshd restart
Try :)
Friday, 4 February 2011
How to chroot(change root) for all user on linux?
Posted on 02:04 by Unknown
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment