美文网首页Linux
ubuntu映射网络驱动器

ubuntu映射网络驱动器

作者: 葡萄月令 | 来源:发表于2017-10-24 12:57 被阅读275次

    1. 首先本地要安装samba文件系统安装命令行如下:

    sudo apt-get install cifs-utils

    2.安装完毕后,修改nsswitch.conf配置文件。

    sudo gedit /etc/nsswitch.conf

    更改

    hosts: files mdns4_minimal [NOTFOUND=return] dns

    为(后面增加wins)

    hosts: files mdns4_minimal [NOTFOUND=return] wins dns

    3.修改fstab配置文件。

    a.先备份下配置文件

    sudo cp /etc/fstab /etc/fstab_old

    b.创建一个校验文件

    gedit ~/.smbcredentials

    内容如下:

    1. username=Ji

    2. password=741852963

    c.创建文件夹用于显示驱动器名称

    sudo mkdir /media/ABM-Share

    d.修改配置文件如下:

    sudo gedit /etc/fstab

    配置如下:

    1. # /etc/fstab: static file system information.

    2. #

    3. # Use 'blkid' to print the universally unique identifier for a

    4. # device; this may be used with UUID= as a more robust way to name devices

    5. # that works even if disks are added and removed. See fstab(5).

    6. #

    7. # /etc/fstab: static file system information.

    8. #

    9. # / was on /dev/sda2 during installation

    10. UUID=e05ea45a-0dbf-4313-9e1a-4640e8af6c7c /              ext4    errors=remount-ro 0      1

    11. # /boot/efi was on /dev/sda1 during installation

    12. UUID=2E11-A546  /boot/efi      vfat    umask=0077      0      1

    13. # swap was on /dev/sda3 during installation

    14. UUID=375c1c38-74dc-4400-b1b2-1a14d5d4d136 none            swap    sw              0      0

    15. #这里是增加的自定义内容

    16. //192.168.2.100/ABM-Share /media/ABM-Share cifs credential=/home/username/.smbcredentials,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 00

    4.连接驱动器

    sudo mount -a

    参考连接:

    http://ubuntuhandbook.org/index.php/2014/08/map-network-drive-onto-ubuntu-14-04/

    相关文章

      网友评论

        本文标题:ubuntu映射网络驱动器

        本文链接:https://www.haomeiwen.com/subject/dwxccxtx.html