linux挂载windows共享目录

今天学习了如何使用linux挂载windows共享目录。

1.先在windows下面共享需要挂载的目录。 

右键共享目录的属性。修改为共享权限。

然后选择安全,选择共享时候输入的用户名和密码。

2、确保linux与windows是在同一个局域网当中。 
3、在linux下面创建一个需要挂载到的目录。 
4、利用mount命令进行挂载。

 mount -t cifs -o username="wangwang",password="wangdan520217" //DESKTOP-AVNCIGS/tomcat /mnt/pacth

其中 //DESKTOP-AVNCIGS/tomcat为windows的共享目录, /mnt/pacth为linux的挂载目录,要先创建。

遇见问题,在进行挂载的时候一直报错。

mount: wrong fs type, bad option, bad superblock on //DESKTOP-AVNCIGS/tomcat,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so

解决方法:是因为没有安装cifs

  root@test:~# mount.cifs
The program 'mount.cifs' is currently not installed.  You can install it by typing:
apt-get install cifs-utils

因为没有安装cifs工具集

apt-get install cifs-utils就ok了。

安装成功后,再次执行命令,成功,linux目录查看。挂载成功

 

posted @ 2017-04-19 17:28  汪一溪  阅读(916)  评论(0编辑  收藏  举报