Chinaunix

标题: 请问chroot命令的真正意义? [打印本页]

作者: frankchan    时间: 2006-01-09 12:40
标题: 请问chroot命令的真正意义?
以下是执行man chroot的结果:
NAME
     chroot -- change root directory(改变root用户的目录)

SYNOPSIS
     chroot [-u user] [-g group] [-G group,group,...] newroot [command]

DESCRIPTION
     The chroot utility changes its current and root directories to the sup-
     plied directory newroot and then exec's command, if supplied, or an
     interactive copy of the user's login shell.

     If the -u, -g or -G options are given, the user, group and group list of
     the process are set to these values after the chroot( has taken place.

从字面意思去解释该命令,chroot改变了当前root的用户目录。但本人不能理解该命令
在那种情况下需要使用?有些书中提到该命令出于安全考虑。有谁能详细讲解一下?
先谢谢了!
作者: congli    时间: 2006-01-09 12:44
chroot -- change root directory(改变root用户的目录)

错!应该是改变根目录.
作者: ldfer    时间: 2006-01-09 12:46
chroot改变了当前root的用户目录

这个你理解的不对吧,chroot是对进程建立新的虚拟的root(/ 根目录),保护了真正的root。
以前bind不是很安全,所以用了chroot
作者: geel    时间: 2006-01-09 13:03
'change root directory' is NOT 'change the root's directory'
作者: FinalBSD    时间: 2006-01-09 13:40
chroot就是让一个程序在一个虚拟的文件系统下运行,此程序需要的所有文件也必须位于这个虚拟的文件系统下。这个文件系统以自定义的/作为自己的根目录。
作者: czjin    时间: 2006-01-10 23:07
OB除了对httpd,bind做了chroot,还对哪些进程也做了chroot? "此程序需要的所有文件也必须位于这个虚拟的文件系统下"那麽怎样才能正确配置它的路径和目录呢?我在httpd和bind上走了许多弯路,到现在还是不明白.
作者: hongzjx    时间: 2006-01-11 09:40
看FAQ吧




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2