How To Set Up an NFS Mount on Ubuntu 12.04
https://www.digitalocean.com/community/articles/how-to-set-up-an-nfs-mount-on-ubuntu-12-04
Step One—Download the Required Software
Start off by using apt-get to install the nfs programs.
apt-get install nfs-kernel-server portmap
nano /etc/exports
Add the following lines to the bottom of the file, sharing both directories with the client:
/home 12.33.44.555(rw,sync,no_root_squash,no_subtree_check) /var/nfs 12.33.44.555(rw,sync,no_subtree_check)
Setting Up the NFS Client
Step One—Download the Required Software
Start off by using apt-get to install the nfs programs.
apt-get install nfs-common portmap
Then go ahead and mount them
mount 12.34.56.789:/home /mnt/nfs/home mount 12.34.56.789:/var/nfs /mnt/nfs/var/nfs
df -h check that the directories have been mounted.
mount use the mount command to see the entire list of mounted file systems
To start the NFS server, you can run the following command at a terminal prompt:
sudo /etc/init.d/nfs-kernel-server start
6.Give the users amir and geir read, write and execute permissions
on the directory /opt/project1
權限設置工具 Setfacl[轉]
http://blog.sina.com.cn/s/blog_701040340100llbj.html
選項–set和–set-file用來設置文件或目錄的acl規則,先前的設定將被覆蓋。
選項-m(–modify)和-M(–modify-file)選項修改文件或目錄的acl規則。
選項-x(–remove)和-X(–remove-file)選項刪除acl規則。
-d,–default
設定默認的acl規則。
-R,–recursive
遞歸的對所有文件及目錄進行操作。
setfacl 命令可以識別以下的規則格式。
[d[efault]:] [u[ser]:]uid [:perms]
指定用戶的權限,文件所有者的權限(如果uid沒有指定)。
[d[efault]:] g[roup]:gid [:perms]
指定羣組的權限,文件所有羣組的權限(如果gid未指定)
[d[efault]:] m[ask][:] [:perms]
有效權限掩碼
[d[efault]:] o[ther] [:perms]
其他的權限
[leonard@localhost ~]$ setfacl -m user:john:rwx ./test.sh
[leonard@localhost ~]$ getfacl –omit-header ./test.sh
http://blog.chinaunix.net/uid-12372814-id-149013.html
Example:
# setfacl -m u:someguy:rx test2
setfacl: Option -m: Invalid argument near character 3
The reason you get this error is because the someguy user does not exist. Setfacl will give the same error for groups that do not exist as well.
http://xmodulo.com/2012/04/how-to-mount-nfs-share-as-regular-user.html
suid、sgid、sticky三種擴-展
https://www.youtube.com/watch?v=THCC7ob4E_w&list=PLCJcQMZOafICYrx7zhFu_RWHRZqpB8fIW
linux中SUID,SGID的應用舉例
執行該程序時,用戶的權限是該程序文件屬主的權限。例如程序文件的屬主是root,那麼執行該程序的用戶就將暫時獲得root賬戶的權限。sgid與suid類似,只是執行程序時獲得的是文件屬組的權限。 你可以看一下passwd這個命令程序的權限設置,它就是設置了suid權限的。 設置方法爲: chmod u+s filename (suid) chmod g+s filename (sgid)
關於UNIX和Linux系統下SUID、SGID的解析
http://tech.ccidnet.com/art/2583/20071030/1258885_1.html