OpenSSH 与 AIX chroot
2008-07-07 08:19:01 来源:WEB开发网配置 chroot 环境
首先,您需要选择一个 chroot 目录。我们将选择 /home/chroot 作为 chrooted 目录。
#mkdir -p /home/chroot
在 /home/chroot 下面,您需要创建所需的目录和子目录,如 dev、dev/pts、etc、usr、usr/bin、usr/sbin、usr/lib 和 tmp。
#pwd
#/home/chroot
#mkdir –p dev/pts etc usr/bin usr/sbin usr/lib/ tmp
因此,我们在 /home/chroot 目录下拥有了以下目录:
/home/chroot # ls -al
total 8
drwxr-xr-x 6 root system 256 Feb 01 12:07 .
drwxr-xr-x 32 root system 4096 Feb 01 12:06 ..
drwxr-xr-x 3 root system 256 Feb 01 12:07 dev
drwxr-xr-x 2 root system 256 Feb 01 12:07 etc
drwxr-xr-x 2 root system 256 Feb 01 12:07 tmp
drwxr-xr-x 5 root system 256 Feb 01 12:07 usr
/home/chroot # ls -al *
dev:
total 0
drwxr-xr-x 3 root system 256 Feb 01 12:07 .
drwxr-xr-x 6 root system 256 Feb 01 12:07 ..
drwxr-xr-x 2 root system 256 Feb 01 12:07 pts
etc:
total 0
drwxr-xr-x 2 root system 256 Feb 01 12:07 .
drwxr-xr-x 6 root system 256 Feb 01 12:07 ..
tmp:
total 0
drwxr-xr-x 2 root system 256 Feb 01 12:07 .
drwxr-xr-x 6 root system 256 Feb 01 12:07 ..
usr:
total 0
drwxr-xr-x 5 root system 256 Feb 01 12:07 .
drwxr-xr-x 6 root system 256 Feb 01 12:07 ..
drwxr-xr-x 2 root system 256 Feb 01 12:07 bin
drwxr-xr-x 3 root system 256 Feb 01 12:07 lib
drwxr-xr-x 2 root system 256 Feb 01 12:07 sbin
/home/chroot # ls -al usr/lib
total 0
drwxr-xr-x 3 root system 256 Feb 01 12:07 .
drwxr-xr-x 5 root system 256 Feb 01 12:07 ..
更多精彩
赞助商链接