zoukankan      html  css  js  c++  java
  • linux挂载共享文件夹

     
    挂载windows共享目录或FTP:
    方式一:包含密码
    Shell代码  收藏代码
    
        sudo mount //192.168.10.22/FTPServer /windows -o username=user,password=abcdefg -t cifs  
    
    
    方式二:密码单独输入
    Shell代码  收藏代码
    
        sudo mount //192.168.10.22/FTPServer /windows -o username=user -t cifs  
        password:abcdefg  
    
    
    卸载:
    Shell代码  收藏代码
    
        umount /FTPServer  
    
    
    
    挂载linux共享目录:
    【修改server端】
    修改/etc/export文件,加入:
    Shell代码  收藏代码
    
        /home/user/source *(rw)  
    
    
    执行如下命令是新增的共享生效
    Shell代码  收藏代码
    
        $/etc/rc.d/init.d/nfs restart  
    
    
    
    【客户端】执行如下命令挂载共享:
    Shell代码  收藏代码
    
        mount -t nfs -o rw 192.168.10.94:/home/user/source /home/user/target  
    
    
    
    设置开机启动自动挂载
    
    1、修改mount_AtoB.sh的密码
    2、将mount_AtoB.sh文件放到/home/user目录下
    3、改变文件的执行权限,执行如下命令:
    Shell代码  收藏代码
    
        chmod 777 mount_AtoB.sh  
    
    
    4、将文件加入到启动文件中:
    Shell代码  收藏代码
    
        $ echo /home/user/mount_94to93.sh >> /etc/rc.d/rc.local  
    
    
    
    mount_AtoB.sh文件内容,其中abcdefg为192.168.10.94的密码:
    Mount_atob.sh代码  收藏代码
    
        set fileformat=unix  
        #!bin/bash  
        mount -t nfs -o rw 192.168.10.94:/home/user/source /home/user/target <<EOF  
        abcdefg  
        EOF  
  • 相关阅读:
    asp.net c#中去掉最后一个字符和去掉第一个字母
    两个div并排
    VS.Net2005中使用本地化功能实现多语言的切换
    gridview嵌套DropDownList選定值[转]
    C# 获取系统时间
    NERDTree,好用的文件浏览器
    通过$.browser来判断浏览器
    vim 智能提示
    让vim显示函数列表
    vim中文乱码解决方法
  • 原文地址:https://www.cnblogs.com/zheh/p/4930412.html
Copyright © 2011-2022 走看看