linux读取windows共享文件

来源:互联网 发布:大数据分析工作 编辑:程序博客网 时间:2024/06/16 07:21

1、mount挂载

首先创建被挂载的目录:

$ mkdir windows

将共享文件夹挂载到windows文件夹:

$ sudo mount -t cifs -o username=share,password=share //192.168.66.198/share ./windows

其中几个参数表示含义:

cifs:Common Internet File System,可以理解为网络文件系统。
usrname:访问共享文件夹的用户名
password:访问密码
//192.168.66.198/share:表示网络文件夹的地址,注意这里最后不能加/,如果是//192.168.66.198/share/则会报如下错误:mount: //192.168.66.198/share/ is not a valid block device

Tips:使用mount挂载的方法在系统重新启动后就会失效,如果希望开机时自动挂载,将下面设置加入/etc/fstab文件最后面就可以了。

//192.168.66.198/share /home/windows cifs defaults,username=share,password=share 0 2

其中/home/windows表示挂载点,就是上面windows目录的完整路径。

0 0
原创粉丝点击