linux上挂载windows共享文件夹

简介:

linux上挂载windows共享文件夹

1.共享windows目录

挂载之前得创建一个有password的用户(当前用户也能够),并将你要挂载的目录进行共享,并赋予读写权限

如图。



2. 挂载windows共享文件夹

命令: mount -t cifs -o username=zhz,password=123456 //10.0.10.1/trunk  /data/developer/test

3. 使用 mount -l 查看是否挂载成功  


4. 卸载已经挂载的共享文件夹

umount /data/developer/test


挂载会遇到一个问题。当window关机后,会导致挂载目录卡死。

当然通过nfs的方式来挂载相同会出现。

解决方法:https://zerged.wordpress.com/2008/04/28/nfs%E7%9A%84%E4%B8%80%E4%B8%AA%E7%BC%BA%E9%99%B7/


windows上挂载linux目录

1. 安装Samba

2. 创建账号

useradd -M -g 500 yourName
smbpasswd -a yourName

3. 改动配置文件 vim /etc/samba/smb.conf

[yourName]
       comment = web root
       path = /data/developer/yourName/shared
       read only = no
       public = yes
       writable = yes
       create mask = 0777
       directory mask = 0777
       valid users = yourName

4. 重新启动samba。service smb restart

5. 測试能否够连接

在Windows资源管理器中訪问:\\測试机IP\yourName


目的:
1. 本机与測试机文件传输

2. 本机调试代码,linux环境执行





本文转自mfrbuaa博客园博客,原文链接:http://www.cnblogs.com/mfrbuaa/p/5421028.html,如需转载请自行联系原作者  


相关文章
|
2月前
|
安全 Linux 生物认证
Nexpose 8.25.0 for Linux & Windows - 漏洞扫描
Nexpose 8.25.0 for Linux & Windows - 漏洞扫描
100 0
Nexpose 8.25.0 for Linux & Windows - 漏洞扫描
|
2月前
|
安全 Linux iOS开发
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
342 53
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
|
2月前
|
安全 Linux 生物认证
Nexpose 8.24.0 for Linux & Windows - 漏洞扫描
Nexpose 8.24.0 for Linux & Windows - 漏洞扫描
184 17
Nexpose 8.24.0 for Linux & Windows - 漏洞扫描
|
2月前
|
SQL 安全 Linux
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
134 1
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
|
2月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
184 1
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
|
2月前
|
Linux API iOS开发
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
209 14
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
|
2月前
|
Linux 虚拟化 iOS开发
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
422 0
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
|
3月前
|
JSON 安全 Linux
Nexpose 8.22.0 for Linux & Windows - 漏洞扫描
Nexpose 8.22.0 for Linux & Windows - 漏洞扫描
147 1
Nexpose 8.22.0 for Linux & Windows - 漏洞扫描
|
2月前
|
Linux iOS开发 计算机视觉
GIMP 3.0.6 (Linux, macOS, Windows) 发布 - 免费开源图像编辑器
GIMP 3.0.6 (Linux, macOS, Windows) 发布 - 免费开源图像编辑器
207 0
|
3月前
|
数据管理 Linux iOS开发
Splunk Enterprise 9.4.5 (macOS, Linux, Windows) - 机器数据管理和分析
Splunk Enterprise 9.4.5 (macOS, Linux, Windows) - 机器数据管理和分析
131 0