Linux权限管理

来源:岁月联盟 编辑:exp 时间:2011-10-14

1.      默认

       一个用户(包括该用户所起的进程)创建的文件会有一个默认的权限,这个权限是$home/profile(or /etc/profile)中设定,用户进入linux时加载,默认的设置为:umask 022(补码,和权限码正好相反)

      如果只是当前session中用,只需在terminal中执行umask 022即可,如果要永久生效,需要修改profile然后执行一下,. /etc/profile

 

2.      查看用户现状:/etc/shadow,/etc/passwd,/etc/group

3.      修改文件权限:

   chmod741 a = chmod u+rwx g+w o+x a

      u=文件所有者,g=group,o=other

      r=4,w=2,x=1 (eg.555=u+rx g+rx o+rx)

      -R参数用的比较多,修改目录下所有文件权限