免费注册 查看新帖 |

Chinaunix

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

怎样禁止一个特定用户执行ps? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-04 00:47 |只看该作者 |倒序浏览

建立了一个专门生产机看日志文件的用户,需要禁止其ps的权限,请教如何处理?
是AIX操作系统。

[ 本帖最后由 Ray001 于 2008-12-4 01:10 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-12-04 00:49 |只看该作者
setfacl -m uxx:--- `which ps`

回楼下:solaris和linux是有的,aix要查一下它的acl工具,应该不是这个……好像叫acledit

[ 本帖最后由 galford433 于 2008-12-4 01:04 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2008-12-04 00:56 |只看该作者
我是在AIX下,没有这个命令。

[ 本帖最后由 Ray001 于 2008-12-4 01:08 编辑 ]

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
4 [报告]
发表于 2008-12-04 10:36 |只看该作者
acledit(1)      - Edits the access control information of a file.
aclget(1)       - Displays the access control information of a file.
aclput(1)       - Sets the access control information of a file.

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
5 [报告]
发表于 2008-12-04 10:37 |只看该作者
AIX 6的话,还可以用RBAC

论坛徽章:
0
6 [报告]
发表于 2008-12-04 23:29 |只看该作者

已解决

export EDITOR=/usr/bin/vi


cd /usr/bin
acledit ps

extended permissions
    enabled
    specify  ---     u:readonly,g:staff

论坛徽章:
0
7 [报告]
发表于 2008-12-06 01:09 |只看该作者
alias ps cd
?

论坛徽章:
0
8 [报告]
发表于 2008-12-06 03:58 |只看该作者
可以简单用shell脚本把ps伪装一下:

[root@localhost dir]# mv /bin/ps /bin/real.ps
[root@localhost dir]# vi /bin/ps

#!/bin/bash
[ $(id -un) = "zhangsan" ] && echo "Permission Denied!" && exit 1
/bin/real.ps "$@"

[root@localhost dir]# chmod 755 /bin/ps

论坛徽章:
1
2015年亚洲杯之韩国
日期:2015-04-24 09:07:02
9 [报告]
发表于 2008-12-06 07:39 |只看该作者
楼上的办法不错呀
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP