由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
CS版 - Linux下如何限制一个命令只能在登陆为指定用户下才能运行? (转载)
相关主题
新手请问一个关于eclipse的问题 (转载)求推荐Perl script的快速入门资料,谢谢!
怎样让一个程序在在UNIX服务器上运行一个script啊? (转载)5包子请教一个网页内容提取的问题
[合集] 现在学啥scripting language比较好?php在Xampp下运行出错,permission denied。求助
请问PERL里怎么判断一个list里面包含一个元素问一个WWW下sub目录的权限问题
如何用 Shell or Perl script 改 directory name《编程逻辑与设计》(The Art of Readable Code)第6版[PDF]
紧急求助:怎么批处理修改几百个文件的文件名?怎样把C文件编译成.x86后缀的目标代码? 怎样运行这种代码? (转载)
怎样用Perl处理中文文本在Slackware上运行程序,出现缺GLIBC_2.0是什么问题 (转载)
请高手帮助几道 perl 编程题 (转载)求助大家 如何用 Eclipse 给一个project加入image (转载)
相关话题的讨论汇总
话题: script话题: linux话题: 登陆话题: perl话题: 运行
进入CS版参与讨论
1 (共1页)
t**********s
发帖数: 930
1
【 以下文字转载自 Linux 讨论区 】
发信人: tennisalways (tennisforever), 信区: Linux
标 题: Linux下如何限制一个命令只能在登陆为指定用户下才能运行?
发信站: BBS 未名空间站 (Wed Jan 27 22:24:13 2010, 美东)
我有个Perl script,希望只有登陆为用户A时才能运行,而登陆为其他用户时无法运行。
是不是可以通过设定文件属性达到这个目的?
对Linux不是很熟,谢谢。
r***e
发帖数: 10135
2
chmod 744

行。

【在 t**********s 的大作中提到】
: 【 以下文字转载自 Linux 讨论区 】
: 发信人: tennisalways (tennisforever), 信区: Linux
: 标 题: Linux下如何限制一个命令只能在登陆为指定用户下才能运行?
: 发信站: BBS 未名空间站 (Wed Jan 27 22:24:13 2010, 美东)
: 我有个Perl script,希望只有登陆为用户A时才能运行,而登陆为其他用户时无法运行。
: 是不是可以通过设定文件属性达到这个目的?
: 对Linux不是很熟,谢谢。

n*****m
发帖数: 73
3
chown A file
chmod 744 file

【在 r***e 的大作中提到】
: chmod 744
:
: 行。

c****j
发帖数: 258
4
S/he is asking about a perl script not a binary exec, even you revoke 001
permision for other users, they can still run the script by calling "perl
script_file".
a dirty way is to add getuid in the script, and stop the execution when it's
not A.
another way is to revoke 100 permission from other users, so it becomes 700 mode

【在 n*****m 的大作中提到】
: chown A file
: chmod 744 file

t**********s
发帖数: 930
5
Not good enough.
Root can still run it.
I want to block it from every one else except A.

【在 n*****m 的大作中提到】
: chown A file
: chmod 744 file

t*****k
发帖数: 1
6
root have access to all files without any limitations. I don't think it is
possible.

【在 t**********s 的大作中提到】
: Not good enough.
: Root can still run it.
: I want to block it from every one else except A.

t******r
发帖数: 88
7
可以只允许root su/sudo

【在 t*****k 的大作中提到】
: root have access to all files without any limitations. I don't think it is
: possible.

a****l
发帖数: 8211
8
how about setting that file to be only readable by that user?

行。

【在 t**********s 的大作中提到】
: Not good enough.
: Root can still run it.
: I want to block it from every one else except A.

c********e
发帖数: 383
9
I think you have to change your script to do so.
1 (共1页)
进入CS版参与讨论
相关主题
求助大家 如何用 Eclipse 给一个project加入image (转载)如何用 Shell or Perl script 改 directory name
请教一个使用secureCRT的问题紧急求助:怎么批处理修改几百个文件的文件名?
请教一个程序怎样用Perl处理中文文本
怎么才能一边运行Matlab一边运行其他程序 (转载)请高手帮助几道 perl 编程题 (转载)
新手请问一个关于eclipse的问题 (转载)求推荐Perl script的快速入门资料,谢谢!
怎样让一个程序在在UNIX服务器上运行一个script啊? (转载)5包子请教一个网页内容提取的问题
[合集] 现在学啥scripting language比较好?php在Xampp下运行出错,permission denied。求助
请问PERL里怎么判断一个list里面包含一个元素问一个WWW下sub目录的权限问题
相关话题的讨论汇总
话题: script话题: linux话题: 登陆话题: perl话题: 运行