移动硬盘挂载后访问权限修改

来源:互联网 发布:javascript基础入门 编辑:程序博客网 时间:2024/06/01 19:55

参考链接:

  1. http://m.blog.csdn.net/blog/duxingzhe0311/18363049

外部USB设备,如移动硬盘,U盘等,在挂载后默认权限为用户可读写,可执行,组及其他用户无读写和执行权限,为方便其他用户访问,须对其访问权限作出调整。

移动硬盘文件初始权限:

# ll /run/media/root/Jaguar/drwx------. 1 root root       4096 Jun 26 21:58 Fast Furiousdrwx------. 1 root root       4096 Jul 11 09:19 GameOfThornes.Season5drwx------. 1 root root       4096 Jul 11 09:08 Hannibal.Season3drwx------. 1 root root          0 Jul 11 09:20 IronMan

其他用户不能访问其中的文件,需要重新赋权:

# umount /run/media/root/Jaguar# mount -o umask=0022 /dev/sdb1 /run/media/root/Jaguar

/run/media/root目录有ACL权限控制

# ll /run/media/total 0drwxrwxr--+ 4 root root 80 Oct 13 20:17 root
# getfacl /run/media/rootgetfacl: Removing leading '/' from absolute path names# file: run/media/root/# owner: root# group: rootuser::rwxuser:root:r-xuser:apache:rwxgroup::---mask::rwxother::r--

需要设置其他用户访问权限

setfacl -m u:apache:rx /run/media/root

httpd-2.4.x配置文件与httpd-2.2.x文件访问权限的配置略有不同。虚拟机

 Order allow, deny  Allow from allto :  Require all grantedThis means that the total configuration for a Directory is now something like:  <Directory /path/to/directory>    Options FollowSymlinks    AllowOverride none    Require all granted  </Directory>
0 0
原创粉丝点击