LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 633|回复: 3

一个关于限止用户目录的问题

[复制链接]
发表于 2004-4-29 18:20:35 | 显示全部楼层 |阅读模式
我的机器上允许远程登录,我想把这些用户限止在自己的目录里,不能用cd命令转到别的目录,有什么办法没有
发表于 2004-4-29 18:59:07 | 显示全部楼层
把用户的shell设置成受限的shell, 即在passwd文件中的登录shell后加一个 -r,然后cp几个常用的命令到这个用户的目录给这个用户的用.
 楼主| 发表于 2004-4-30 06:38:29 | 显示全部楼层
能详细说说-r的含义吗?受限用户是什么样的用户?
发表于 2004-4-30 07:51:57 | 显示全部楼层
> 能详细说说-r的含义吗?受限用户是什么样的用户?

真够懒的, 都man page都不会吗?

man bash


RESTRICTED SHELL
       If  bash  is started with the name rbash, or the -r option
       is supplied at invocation, the shell  becomes  restricted.
       A  restricted  shell is used to set up an environment more
       controlled than the standard shell.   It  behaves  identi-
       cally  to  bash  with the exception that the following are
       disallowed or not performed:

       o      changing directories with cd

       o      setting or unsetting the  values  of  SHELL,  PATH,
              ENV, or BASH_ENV

       o      specifying command names containing /

       o      specifying  a  file name containing a / as an argu-
              ment to the .  builtin command

       o      Specifying a filename  containing  a  slash  as  an
              argument  to the -p option to the hash builtin com-
              mand

       o      importing function definitions from the shell envi-
              ronment at startup

       o      parsing the value of SHELLOPTS from the shell envi-
              ronment at startup

       o      redirecting output using the >, >|, <>, >&, &>, and
              >> redirection operators

       o      using the exec builtin command to replace the shell
              with another command

       o      adding or deleting builtin commands with the -f and
              -d options to the enable builtin command

       o      Using the enable builtin command to enable disabled
              shell builtins

       o      specifying the -p option  to  the  command  builtin
              command

       o      turning  off  restricted mode with set +r or set +o
              restricted.

       These restrictions are enforced after  any  startup  files
       are read.

       When  a command that is found to be a shell script is exe-
       cuted (see COMMAND EXECUTION above), rbash turns  off  any
       restrictions in the shell spawned to execute the script.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表