zoukankan      html  css  js  c++  java
  • Linux 挂载windows目录

    1.默认情况下,Linux服务器会装有samba-client,但是没有装samba-server。但是访问Windows系统共享,安装有samba-client就可以了。

    [root@test ~]# rpm -qa | grep samba
    samba-3.6.23-14.el6_6.x86_64
    samba-client-3.6.23-14.el6_6.x86_64
    samba-common-3.6.23-14.el6_6.x86_64
    samba-winbind-clients-3.6.23-14.el6_6.x86_64
    samba-swat-3.6.23-14.el6_6.x86_64
    samba-winbind-devel-3.6.23-14.el6_6.x86_64
    samba-winbind-3.6.23-14.el6_6.x86_64
    samba-winbind-krb5-locator-3.6.23-14.el6_6.x86_64

    如果不存在就安装samba

    [root@test ~]# yum -y install samba

    2.检查是否有安装

    [root@test ~]# rpm -qa | grep  cifs-utils

    [root@test ~]# yum -y install cifs-utils

    3.挂载目录

    假设Windows的IP为192.168.1.106共享目录为C://Intel,则其共享地址为192.168.1.106/Intel。

    挂在方法:

    mount -t cifs //192.168.1.106/intel /mnt -o username='jsme',password='312'

    此处username和password都是Windows主机的用户名和密码,该方法为root用户使用,挂载后owner和group都为root且挂在后目录不能用chmod修改目录权限

    mount -t cifs //192.168.2.26/device /mnt/share -o username=share,password=share,rw,file_mode=0777,dir_mode=0777,setuid=509,setgid=101

    其中,uid=509, gid=101是一个普通用户dba /mnt/share权限位是0777,所有用户有完全访问权限

    卸载方法:

    umount /mnt

    ------------------------------------------------------------------------------------------

    以上方法立即生效但是在Linux主机重启后失效,永久生效方法为

    修改/etc/fstab文件,文件最后加入:

    //192.168.1.106/Inetl  /mnt cifs  username=‘jsme’,password=‘312’ ,rw  0 0

    或在文件/etc/rc.local添加

    mount -t cifs //192.168.1.106/intel /mnt -o username='jsme',password='312'

  • 相关阅读:
    Eclipse连接MySQL数据库(傻瓜篇)
    JMeter监控内存及CPU ——plugin插件监控被测系统资源方法
    fiddler抓取手机端的数据流量包
    python 字典(dictionary)一些方法
    python 循环语句
    Charles 抓 HTTPS 包
    python RSA 加密与签名
    从零开始做一个Jmeter性能测试
    [python之路]变量和字符编码
    [python之路]简单介绍
  • 原文地址:https://www.cnblogs.com/GNblog/p/8259363.html
Copyright © 2011-2022 走看看