免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 2510 | 回复: 10
打印 上一主题 下一主题

如何把一个Linux用户限制到一个目录? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-30 15:19 |只看该作者 |倒序浏览
如何把一个Linux用户限制到一个目录?只可以在它的目录操作,而不可以操作其他目录,包括不能浏览其他目录,即对其他目录不可读。

另外,怎么让他在该目录只有编辑、修改文件等功能,不能执行其他对系统有影响的命令

谢谢

论坛徽章:
0
2 [报告]
发表于 2009-03-30 15:20 |只看该作者
讨论过很多次了,这是对Linux/Unix缺乏理解时,容易问的一个问题。

论坛徽章:
0
3 [报告]
发表于 2009-03-30 15:56 |只看该作者
原帖由 maluyao 于 2009-3-30 15:20 发表
讨论过很多次了,这是对Linux/Unix缺乏理解时,容易问的一个问题。


那就说清楚点呀,或者给个链接什么的
我也想学习一下~

论坛徽章:
34
亥猪
日期:2015-03-20 13:55:11戌狗
日期:2015-03-20 13:57:01酉鸡
日期:2015-03-20 14:03:56未羊
日期:2015-03-20 14:18:30子鼠
日期:2015-03-20 14:20:14丑牛
日期:2015-03-20 14:20:31辰龙
日期:2015-03-20 14:35:34巳蛇
日期:2015-03-20 14:35:56操作系统版块每日发帖之星
日期:2015-11-06 06:20:00操作系统版块每日发帖之星
日期:2015-11-08 06:20:00操作系统版块每日发帖之星
日期:2015-11-19 06:20:00黄金圣斗士
日期:2015-11-24 10:43:13
4 [报告]
发表于 2009-03-30 16:29 |只看该作者
chroot ?

论坛徽章:
0
5 [报告]
发表于 2009-03-30 23:07 |只看该作者
不能浏览其他文件夹,他怎么执行命令?!
一个普通用户本来就只能在很有限的范围内创建、修改文件,本来也不能做什么对系统有害的操作。

论坛徽章:
0
6 [报告]
发表于 2009-03-30 23:54 |只看该作者
楼主说的可能是ftp

论坛徽章:
1
操作系统版块每日发帖之星
日期:2015-07-11 22:20:00
7 [报告]
发表于 2009-03-31 00:03 |只看该作者
user, group, 750, 700

论坛徽章:
0
8 [报告]
发表于 2009-03-31 10:29 |只看该作者
我是路过的,支持个先.......

论坛徽章:
0
9 [报告]
发表于 2009-03-31 12:55 |只看该作者
你去查查一个叫做rbash的东西,或许可以实现。

论坛徽章:
0
10 [报告]
发表于 2009-04-01 10:30 |只看该作者

回复 #9 jerrywjl 的帖子

rbash: restricted 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 identically to bash with the exception that the following are disallowed or not performed:

changing directories with cd
setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV
specifying command names containing /
specifying a file name containing a / as an argument to the . builtin command
Specifying a filename containing a slash as an argument to the -p option to the hash builtin command
importing function definitions from the shell environment at startup
parsing the value of SHELLOPTS from the shell environment at startup
redirecting output using the >, >|, <>, >&, &>, and >> redirection operators
using the exec builtin command to replace the shell with another command
adding or deleting builtin commands with the -f and -d options to the enable builtin command
Using the enable builtin command to enable disabled shell builtins
specifying the -p option to the command builtin command
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 executed, rbash turns off any restrictions in the shell spawned to execute the script
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP