磁盘配额的配置:
首先我们在文件/etc/fstab中的/dev/vo10/home /home 的这一行在defaults后面添加上usrquota,若是还有组就应再添加grpquota。
然后再: mount -o remount /home
接下来就是扫描所需要的磁盘是否有多余的空间可设置磁盘配额;
quotacheck -c /home 这时会在/home目录下产生一个文件aquota.usr
然后在启动磁盘配额: quotaon /home
这时我们就可以编辑了: edquota username 会出现:
filesystem blocks quota limit
里面的内容根据要求配置完,这就完成了给用户的磁盘配额。
可以用quota 来查看你所配置的。
也可以基于文本界面来配置nis。
setup 选择第一项,勾上nis然后就进入配置nis了。
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
NIS配置:
首先你必须装了ypbind,yp-tools和portmap等软件,若是提供nis服务的须安ypserv
在文件/etc/sysconfig/network中加入 NISDOMAIN=notexample 这是加入nis域的根据情况你可以修改。
service portmap status (查看portmap的状态的是否运行正常)
客户端的配置:
在/etc/yp.conf 中 添加 domain notexample server 192.168.0.254
还要修改文件: /etc/nsswitch.conf 在passwd,hosts的那几项添加 nis
yptest -d notexample (测试用的)
service ypbind start (启动ypbind的服务的)
可以用 rpcinfo -p localhost或IP (可以查看本地或服务器的ypserver服务的)
若是想开机启动: chkconfig ypbind on
我们可以用命令 su - username 来测试下。这时切换的用户是没家目录的。
配置访问控制列表(ACL)
首先你的filesystem是支持acl的,如: mount -o remount,acl /home
可以用命令设置其默认支持acl: tune2fs /dev/sda2 -o acl
设置acl: setacl -m <rules> <files>
如 setfacl -m u:redhat:rwx test/ (redhat是个用户,rwx是执行权限)
setfacl -x u:redhat test/ (删除用户的acl)
g是给组设置acl,
setfacl -m d:u:redhat:rw (这是设置默认的acl)
setfacl -b (移除所有的acl)-k (移除默认的acl)
getfacl test/ 查看配置的acl。
转载于:https://blog.51cto.com/myllinux2010/364555