p*f
4 楼
let's say file1 & file2 are in directory ~user0/secret,
and if ~user0, ~user1 & ~user2 are in a single filesystem
you may try this:
user0$ chmod 711 ~ ~/secret
user0$ chmod 644 ~/secret/{file1,file2}
user1$ mkdir ~/secret
user1$ chmod 700 ~/secret
user1$ ln ~user0/secret/{file1,file2} ~/secret
same thing for user2
user0$ chmod 700 ~ (optional)
user0$ chmod 700 ~/secret
user0$ chmod 666 ~/secret/{file1,file2}
【在 p******r 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 好像不对吧。chmod是基于group的,而非root用户不能随便添加group.
: 就不能用chmod这么做。
: 例如,三个分属于不同组的用户user0,user1和user2. 文件所有者user0
: 希望跟user1,2分别共享file1和file2。普通用户应该怎么操作?
p*r
5 楼
这样的结果是file1,2被所有人看见,不是我要求的user1只能访问file1,
user2只能访问file2的“分别共享”
【在 p******f 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
:
: let's say file1 & file2 are in directory ~user0/secret,
: and if ~user0, ~user1 & ~user2 are in a single filesystem
: you may try this:
: user0$ chmod 711 ~ ~/secret
: user0$ chmod 644 ~/secret/{file1,file2}
: user1$ mkdir ~/secret
: user1$ chmod 700 ~/secret
: user1$ ln ~user0/secret/{file1,file2} ~/secret
: same thing for user2
相关阅读
[转载] 谁能帮忙解决这个问题?emacs里怎么把两个eps图并排放在一起呀?[转载] 有用OS X server 10.2的吗?? 实在太郁闷了!!!ls in Unix (Sun)为什么关不了机?[转载] BBS架好了。帮忙测试一下吧How to redirect error messages to a file?question about a command in UNIXCommon Desktop Environmenta problem怎么在Unix/Linux下安装Matlab?How to make a hard copy from a info file?help about chmod[转载] Pthread Multiprogrammingfiles write rightsNIS slave servershow to change the backgroud color?求教!请教client & server program. 感激涕零Re: [转载] Unix C 求教: 怎么样把一个c程序compile成lib/下的 .a, .so文件请问Soalris 8的cache line size 是多少?