windows目录通过网络共享给linux机器挂载,实现windows编码,linux编译。

linux挂载通过网络windows目录

windows目录通过网络共享给linux机器挂载,实现windows编码,linux编译。
CIFS (Common Internet File System) : 通用Internet文件系统,在windows主机之间进行网络文件共享是通过使用微软公司自己的CIFS服务实现的。

一、步骤

 1.windows右键给共享目录(可以是普通共享也可以是高级共享区别在于最后的共享路径)。
 2.linux安装cifs组件
 	centos:yum install cifs-utils
 	ubuntu:apt-get install cifs-utils
 3. linux挂载目录
	mount  -t cifs //192.168.1.4/repos /mnt/vmshared -o username="USER-20190117NC"
	网络路径:\\USER-20190117NC\repos
	username:是网络路径的用户部分。
	-t:指定档案系统的型态 。
	192.168.1.4:是与linux同网段ip。
	repos:共享文件windows的路径。
	/mnt/vmshared:是想挂载在linux的目录路径,要先创建。

二、报错处理

1、mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
解决:在windows高级共享设置中设置关闭密码保护共享windows目录通过网络共享给linux机器挂载,实现windows编码,linux编译。