免费注册 查看新帖 |

Chinaunix

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

关于指定用户运行某个程序的问题!! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-19 12:57 |只看该作者 |倒序浏览
系统是:redhatAS4
我想运行autodaemond这个程序的时候必须以vpopmail用户运行

[root@web1 init.d]# chown vpopmail.root authdaemond
[root@web1 init.d]# chmod 1700 authdaemond

可是每次启动这个服务之后显示的用户还是root
[root@web1 init.d]# ps -ef | grep authdaemond
root     23948 23947  0 11:17 ?        00:00:00 /usr/local/libexec/courier-authlib/authdaemond

论坛徽章:
0
2 [报告]
发表于 2007-07-19 15:25 |只看该作者
su - vpopmail -c /path/autodaemond

论坛徽章:
4
CU十二周年纪念徽章
日期:2013-10-24 15:41:34狮子座
日期:2014-02-10 17:22:57技术图书徽章
日期:2014-02-18 08:44:12技术图书徽章
日期:2014-04-29 14:15:42
3 [报告]
发表于 2011-05-13 15:11 |只看该作者
找到了

论坛徽章:
0
4 [报告]
发表于 2011-05-13 18:32 |只看该作者
另一种方案:利用suid

  1. [root@RHEL4 test]# ls -ld ./
  2. drwxrwxrwx  2 root root 4096 May 13 18:23 ./

  3. [root@RHEL4 test]# touch file1

  4. [root@RHEL4 test]# ls -l
  5. total 0
  6. -rw-r--r--  1 root root 0 May 13 18:24 file1

  7. [root@RHEL4 test]# cp /bin/touch  .

  8. [root@RHEL4 test]# chown  yanu touch

  9. [root@RHEL4 test]# ls -l
  10. total 32
  11. -rw-r--r--  1 root root     0 May 13 18:24 file1
  12. -rwxr-xr-x  1 yanu root 32480 May 13 18:24 touch

  13. [root@RHEL4 test]# chmod +s touch

  14. [root@RHEL4 test]# ls -l
  15. total 32
  16. -rw-r--r--  1 root root     0 May 13 18:24 file1
  17. -rwsr-sr-x  1 yanu root 32480 May 13 18:24 touch

  18. [root@RHEL4 test]# ./touch  file2

  19. [root@RHEL4 test]# ls -l
  20. total 32
  21. -rw-r--r--  1 root root     0 May 13 18:24 file1
  22. -rw-r--r--  1 yanu root     0 May 13 18:25 file2
  23. -rwsr-sr-x  1 yanu root 32480 May 13 18:24 touch

  24. [root@RHEL4 test]#
复制代码

论坛徽章:
0
5 [报告]
发表于 2011-05-13 19:42 |只看该作者
你是以vpopmail用户登录,并运行autodaemond这个程序的吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP