ITPub博客

首页 > Linux操作系统 > Linux操作系统 > mount.cifs windows共享目录权限755问题

mount.cifs windows共享目录权限755问题

原创 Linux操作系统 作者:李晨超 时间:2014-11-13 10:26:44 1 删除 编辑

针对redhat 6.3系统。

通过linux 的mount命令挂载windows下的共享目录,挂载后目录权限为755,普通用户没有权限写入。

点击(此处)折叠或打开

  1. [root@lccwyy ~]# mount -t cifs //192.168.50.34/temp /root/aa -o username=allenli,password=lcc201314,rw,
  2. [root@lccwyy ~]# ls -l | grep aa
  3. drwxr-xr-x. 1 root root 0 Nov 13 2014 aa
  4. [root@lccwyy ~]#

chmod给目录加权限出现错误,和普通的目录不同。

点击(此处)折叠或打开

  1. [root@lccwyy ~]# chmod 777 aa
  2. chmod: changing permissions of `aa : Permission denied

通过linux的 man mount.cifs 简单的了解下。

NAME
       mount.cifs - mount using the Common Internet File System (CIFS)
       cifs的意思是通用网络文件系统。
DESCRIPTION
       This tool is part of the cifs-utils suite.
       

       mount.cifs mounts a Linux CIFS filesystem. It is usually invoked indirectly by the mount(8) command when using the "-t cifs" option. This command only works in Linux, and the kernel must support the cifs filesystem. The CIFS protocol is the successor to the SMB protocol and is supported by most Windows servers and many other commercial servers and Network Attached Storage appliances as well as by the popular Open Source server Samba.
    
  mount.cifs用于挂载linux的CIFS文件系统,当用-t cifs命令的时候间接的涉及了mount(8)命令。这个命令只能在linux上执行,以及内核必须支持cifs文件系统。cifs协议的前身是smb协议,被大部分的windows、商业服务器、存储应用支持。(mount.cifs跟mount -t cifs唯一的区别就是mount.cifs在samba软件包里,而mount在util-linux软件包里。)

       The mount.cifs utility attaches the UNC name (exported network resource) specified as service (using //server/share syntax, where "server" is the server name or IP address and "share" is the name of the share) to the local directory mount-point.
       
mount -t cifs 192.168.50.34:temp /root/aa 通过类似的形式使用。192.168.50.34是windows的ip地址,temp目录是windows的共享目录。


       Options to mount.cifs are specified as a comma-separated list of key=value pairs. It is possible to send options other than those listed here, assuming that the cifs filesystem kernel module (cifs.ko) supports them. Unrecognized cifs mount options passed to the cifs vfs kernel code will be logged to the kernel log.


       mount.cifs causes the cifs vfs to launch a thread named cifsd. After mounting it keeps running until the mounted resource is unmounted (usually via the umount utility).
         mount.cifs 挂载后会有一个cifsd进程出现


继续查看下mount.cifs的语法。
file_mode=arg
 If the server does not support the CIFS Unix extensions this overrides the default file mode.
dir_mode=arg
If the server does not support the CIFS Unix extensions this overrides the default mode for directories.

可以通过file_mode 和dir_mode 来设置权限,覆盖默认的755权限。

点击(此处)折叠或打开

  1. [root@lccwyy ~]# mount -t cifs //192.168.50.34/temp /root/aa -o username=allenli,password=lcc201314,rw,dir_mode=0777,file_mode=0777
  2. [root@lccwyy ~]# ls -l | grep aa
  3. drwxrwxrwx. 1 root root 0 Nov 13 2014 aa
  4. [root@lccwyy ~]#








来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25756293/viewspace-1330757/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-05-09

  • 博文量
    5
  • 访问量
    80746