1, Win下选中文件夹,属性设置为共享,红圈中的为共享路径,挂载时//ip/共享路径

2,

3,Linux需要安装这两个软件

rpm -qa | grep samba-client

rpm -qa | grep cifs=utils

else

yum install samba-client

yum install cifs-utils

4,

可能提示

创建成功

如果需要每次系统启动都挂载这个目录,那就需要在/etc/fstab 文件里把需要挂载项添加进去

添加行:

//192.168.1.100/workspace   /mnt/share cifs  auto,username=‘echo’,password=‘123456’  0 0

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

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

通过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权限。

mount -t cifs //192.168.50.34/temp /root/aa -o username=allenli,password=lcc201314,rw,dir_mode=0777,file_mode=0777

Linux挂载Win共享文件夹 一的更多相关文章

  1. Linux挂载Win共享文件夹_VmwareTools

  2. Linux 挂载windows共享文件夹

    Linux 挂载windows共享文件夹 准备工具: 1.windows 共享出来文件夹. 2.Linux 安装cifs文件挂载属性 3.其他 windows ip: 192.168.27.99 Li ...

  3. Linux 挂载Windows共享文件夹和NAS存储

    summary: [Linux 挂载共享存储] 概述 将Windows共享文件夹和NAS存储挂载至Linux. Linux系统环境:CentOS 挂载共享存储 查看外部主机共享了哪些目录 smbcli ...

  4. linux挂载windows共享文件夹

    1.建立共享文件夹 2.在linux中挂载共享目录 #mount -t cifs -o username=administrator,password=你的系统账号密码 //192.168.0.22/ ...

  5. linux挂载windows共享文件夹出错,提示mount error(13): Permission denied

    完整的可以工作的命令行: mount -v -t cifs -o username=clouder,password=123456,iocharset=utf8,sec=ntlm //172.28.1 ...

  6. Linux挂载NAS共享文件夹

    [root@ftp:/mnt] > mount -o username=user01,password=1234567890 //192.168.31.20/share /mnt/nas [ro ...

  7. VMware下Linux虚拟机访问本地Win共享文件夹

    VMware下Linux虚拟机访问本地Win共享文件夹 : 访问共享文件夹的步骤如下: 1.先在本地Win创建一个需要共享到虚拟机中的共享目录,如  F:\share. 2.打开你的VMware,选择 ...

  8. linux上挂载windows共享文件夹

    linux上挂载windows共享文件夹 1.共享windows目录 挂载之前得创建一个有password的用户(当前用户也能够),并将你要挂载的目录进行共享,并赋予读写权限 如图. watermar ...

  9. VMware,win7与linux centos6.4文件互传,linux下挂载windows共享文件夹,vmware tools安装方法

    本方法是以win7,VMware9.0.1 ,centos6.4为基础实验的. 对于linux的初级使用阶段,都会Windows中使用linux虚拟机VMWare或者其它的.在Windows与linu ...

随机推荐

  1. springboot的aop编程

    以下内容是模仿杨开振<<深入浅出springboot 2.x>>的4.2章节内容. 开始前,需要先修改pom.xml,加入以下内容 <!-- https://mvnrep ...

  2. Percona-Tookit工具包之pt-table-sync

      Preface       We've used pt-table-checksum to checksum the different table data bwtween replicatio ...

  3. web前端总结面试问题<经常遇到的手写代码>

    冒泡排序 var arr = [5,8,3,6,9] for(var i=0;i<arr.length;i++){ for(var j=i+1;j<arr.length;j++){ if( ...

  4. Yaf学习(二)----Yaf初体验

    1.hello world 1.1 用yaf输出hello world 1.首先配置host,nginx 2.host不用多说,指向虚拟机IP即可 1.2 重点说一下nginx (只说server块) ...

  5. 终于搞定了cxgrid的多行表头(转终于搞定了cxgrid的多行表头 )

    终于搞定了cxgrid的多行表头 转自:http://mycreature.blog.163.com/blog/static/556317200772524226400/     这一周都在处理dbg ...

  6. 11 非阻塞套接字与IO多路复用(进阶)

    1.非阻塞套接字 第一部分 基本IO模型 1.普通套接字实现的服务端的缺陷 一次只能服务一个客户端! 2.普通套接字实现的服务端的瓶颈!!! accept阻塞! 在没有新的套接字来之前,不能处理已经建 ...

  7. 二叉树和二叉查找树--数据结构与算法JavaScript描述(10)

    二叉树和二叉查找树 概念 树是一种非线性的数据结构,以分层的方式存储数据. 树被用来存储具有层级关系的数据,比如文件系统的文件: 树还被用来存储有序列表. 一棵树最上面的节点称为根节点. 如果一个节点 ...

  8. P2340 奶牛会展(状压dp)

    P2340 奶牛会展 题目背景 奶牛想证明它们是聪明而风趣的.为此,贝西筹备了一个奶牛博览会,她已经对N 头奶牛进行 了面试,确定了每头奶牛的智商和情商. 题目描述 贝西有权选择让哪些奶牛参加展览.由 ...

  9. 开源版本 hadoop-2.7.5 + apache-hive-2.1.1 + spark-2.3.0-bin-hadoop2.7整合使用

    一,开源软件版本: hadoop版本 : hadoop-2.7.5 hive版本 :apache-hive-2.1.1 spark版本: spark-2.3.0-bin-hadoop2.7 各个版本到 ...

  10. linux基础重要命令小节

    此为L005&&L006课程内容的一个总结. 命令: 基本形式 命令 [参数] [路径或文件] 例:ls -ld /data pwd 目前所在目录 [root@moban /]# pw ...