建立windows共享目录

右击要共享的文件夹-->属性-->高级共享-->添加用户-->添加完全控制权限

假设建立的共享地址为\\192.168.1.100\Linux

获取当前登录user的gid,uid

id username

建立挂载目录

mkdir /mnt/win

挂载目录

 sudo mount -t cifs //192.168.1.100/Linux /mnt/win -o username=,password=,gid=,uid=

其中username,password为windows共享目录添加的账号和密码

如果出现错误:

mount error(): Permission denied
Refer to the mount.cifs() manual page (e.g. man mount.cifs)

则在挂载参数后面加上sec=ntlm,或者sec=ntlmssp

username=,password=,gid=,uid=,sec=ntlm

原因如下:

"sec" is the security mode and determines how passwords are encrypted between server and client ( even if you don't require passwords ).

ntlm used to be the default which is why you never had to specify it discretely. Things have moved on however so the default is now ntlmssp. If you are accessing something which doesn't speak ntlmssp you have to override the new default with the old one.

Most NAS devices use older technology so they often require ntlm. If you access an OSX samba share however it requires ntlmssp so before you had to specify that in the mount options but now you don't.

查看挂载目录

df -h

自动挂载共享目录

每次启动都来挂载很麻烦?可以让系统每次启动时就自动挂载

编辑/etc/fstab

sudo vi /etc/fstab

在最后添加一行

//192.168.1.100/Linux /mnt/win cifs username=,password=,gid=,uid=,auto 0 0

重启一下看看

sudo shutdown -r
df -h

成功了~

ubuntu 挂载windows共享目录的方法的更多相关文章

  1. Linux访问Windows共享目录的方法——smbclient

    之前写过Ubuntu访问Windows共享目录,里面主要介绍如何在GUI上访问windows共享目录. 本文侧重于整理通过命令行访问的方法. 先确保smbclient.ubuntu下可以直接运行下面命 ...

  2. linux系统下挂载windows共享目录

    在工作中有时我们需要在linux上挂载windows共享目录.首先我们需要学会在linux上查看windows共享了那些目录.查看操作需要安装samba-client. [root@ ~]# yum ...

  3. Ubuntu访问Windows共享目录

    你可以选择目录挂载的形式,也可以选择直接使用图形界面的形式. 下面直接在文件浏览器中打开windows共享目录. 1 安装samba sudo apt-get install samba 2 打开一个 ...

  4. Linux开发环境搭建三 使用mount -t cifs 挂载windows共享目录方法与问题解决

    转载链接:https://blog.csdn.net/fuyuande/article/details/82915800 嵌入式开发通常是在linux环境下编译,windows下开发,这就需要在lin ...

  5. Linux挂载Windows共享目录

    在windows中设置共享目录并添加权限用户 把Window系统的文件共享挂载到linux centos 目录下的方法步骤: 1.先在windows下面共享需要挂载的目录. 2.确保linux与win ...

  6. 本地虚拟机挂载windows共享目录搭建开发环境

    关闭防火墙(本地环境 直接关掉即可)service iptables stop检查是否安装了需要的samba软件包rpm –q samba如果没安装yum install samba system-c ...

  7. Centos7挂载windows共享目录

    将windows的共享目录挂载到Centos7 查看是否有mount.cifs命令,如果没有,在线安装 [root@dropbox-bak01 ~]# yum install cifs-utils - ...

  8. centos 挂载windows共享目录

    su (获取root权限) yum install samba 安装samba (其实我们只用到samba里面的winbind以便我们能够用windows机器的名称找到该机器的网络地址,在下面叙述的过 ...

  9. CentOS虚拟机挂载Windows共享目录

    Windows文件共享使用了SMB协议(又称CIFS协议),该协议主要提供了文件共享和打印共享功能,分别使用TCP 139和445端口.UNIX.Linux系统提供了该协议的开源实现samba.为了方 ...

随机推荐

  1. C#基础知识系列十(集合)

    前言 本节主要是来了解学习集合,以方便在程序编写时,什么地方该选用什么集合,让程序更健壮的运行起来.在学习了解集合之前,首先需要了解一些数据结构方面的知识.下面我们就先简单的来看一下数据结构. 数据结 ...

  2. jquery事件重复绑定的快速解决方法

    click等事件 解决:使用unbind("click")方法先解除绑定的事件再绑定新事件,即在给对象绑定事件之前先移除该对象上的原有事件 1 $("#test2&quo ...

  3. C# 各种数据类型的最大值和最小值常数

    using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO ...

  4. dashboard

    http://www.htmleaf.com/pins/chart-doc/index.html http://www.flotcharts.org/flot/examples/ https://gi ...

  5. Oracle学习系列1-7

    Oracle学习系列1 两个服务必须启动: OracleOraDb10g*TNListener 和 OracleService*** 使用sqlplusw先进行环境的设置 set linesize 3 ...

  6. find命令学习

    find命令与locate命令的区别: locate: 非实时查找: 依赖于索引,而索引构建非常占用资源,索引的创建是在系统空闲时系统自动进行,可以用updatedb命令更新索引: 查找速度快: 非精 ...

  7. 配置recovery_min_apply_delay后重启standby节点报错:psql: FATAL: the database system is starting up

    环境: pg版本:PostgreSQL 9.4.4 on x86_64 系统版本:CentOS release 6.6 linux内核版本:2.6.32-504.8.1.el6.x86_64 今天测试 ...

  8. spl_autoload_register更改框架文件引用模式

    今天单点登陆要用到 spl_autoload_register,但是YII的Yii::autoload在包含失败的时候会抛异常,就不会执行(spl_autoload_call)其他spl_autolo ...

  9. Centreon插件nagvis

    ======================================= http://docs.nagvis.org/1.8/en_US/index.html https://document ...

  10. require.js+backbone.js基本使用

    一.菜单{ //银行卡基础信息维护 rsId: 'menu.param.cardbin', iconCls: 'icon-double-angle-right', name: menusLang._( ...