快速配置 Samba 将 Linux 目录映射为 Windows 驱动器
1,列出某个IP地址所提供的共享文件夹
smbclient -L 198.168.0.1
3,像FTP客户端一样使用smbclient
smbclient //192.168.0.1/tmp -U username%password
4,例,创建一个共享文件夹
smbclient -c "mkdir share1" //192.168.0.1/tmp -U username%password
如果用户共享//192.168.0.1/tmp的方式是只读的,会提示
NT_STATUS_ACCESS_DENIED making remote directory \share1
5,除了使用smbclient,还可以通过mount和smbcount挂载远程共享文件夹
mount -t smbfs -o username=administrator,password=123456 //192.168.0.1/tmp /mnt/tmp
提示出错:
mount: unknown filesystem type 'smbfs'
查资料后,说smbfs改为cifs了,所以要用下面的方法:
# mount -t cifs -o username="administrator",password="" //192.168.1.101/cp /mnt/ntfs
成功!!
smbmount //192.168.0.1/tmp /mnt/tmp -o username=administrator
访问目录:
ubuntu
一. Samba的安装:
# sudo apt-get insall samba
# sudo apt-get install smbfs
二. 创建共享目录:
# mkdir /home/willis/share
# sodu chmod 777 /home/willis/share
三. 创建Samba配置文件:
1. 保存现有的配置文件
# sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
2. 创建新的Samba配置文件
# sodu vim /etc/samba/smb.conf
; ############### smb.conf #######################
[global]
; 创建工作组
workgroup = MYGROUP
; 安全模式, 我们设置最低安全级别
security = share
; 是否允许guest用户访问
guest ōk = yes
[share]
; 共享文件夹路径
path = /home/willis/share
; 读权限
browseable = yes
; 写权限
writeable = yes
四. 测试文件配置结果
# testparm
五. 重启Samba服务
# /etc/init.d/smbd restart
六. 退出重新登陆或者重启机器
七. 测试登陆
# smbclient -L //localhost/share
从远程的机子上测试:
# smbclient //<samba_server_ip>/share
成功咯! :-)
八. 参考资料
在Ubuntu中设置samba共享可读写文件夹:
http://forum.ubuntu.org.cn/about20852.html&highlight=sambahttp://wiki.ubuntu.org.cn/Samba
一、局域网内的 Linux 服务器上操作步骤:
1、安装samba(CentOS Linux):
2、创建www账号
/usr/sbin/useradd -g www www
mkdir -p /data0/knose/
chmod 777 /data0/knose/
mkdir -p /data0/htdocs/
chown -R www:www /data0/htdocs/
chmod 777 /data0/htdocs/
cat /etc/passwd | mksmbpasswd.sh> /etc/samba/smbpasswd
3、创建samba配置文件
vi /etc/samba/smb.conf
输入以下内容:
server string = Samba Server
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[knose]
workgroup = root
netbios name = root
path = /data0/knose
browseable = yes
writeable = yes
[web]
workgroup = www
netbios name = www
path = /data0/htdocs
browseable = yes
writeable = yes
4、为samba用户www、root设立一个密码:
smbpasswd -a root
5、启动samba:
二、局域网内的 Windows 服务器上操作步骤:
1、Windows 上访问 samba,在“我的电脑”中输入:
2、Windows 断开 samba 共享连接,在【开始】→【运行】→【cmd】回车中输入:
3、将 samba 共享的 Linux 目录,映射成 Windows 的一个驱动器盘符:



三、跨平台C/C++代码编译、调试:
用 Windows 下的编辑器编写、修改跨平台的C/C++代码,保存后,无需复制到其他地方,即可同时用 Windows 下的 Visual Studio,Linux 下的 g++、gcc、gdb,编译、调试程序了。


注意:在samba共享的驱动器上执行“.bat”批处理脚本,会导致 Windows 蓝屏,这一点需要注意。
原文:http://www.unixmen.com/how-to-configure-samba-using-a-graphical-interface-in-ubuntu/
Installing Samba:
First thing we need to do is to install samba, go to Software center in Ubuntu and search for samba then install the package. If you want to install it via terminal then copy this command :
sudo apt-get install samba samba-common
Installing Samba Server configuration Tool:
Now install the graphical interface System-config samba
sudo apt-get install system-config-samba
Configuration of samba using a graphical interface:
Now we will try for example to share the directory /home/pirat9/share folder to do that,
First open GUI samba server configuration tool by going to System–> Administration–>Samba

Add the folder you want to share and setup the permissions access.


Now right click on the folder directory you want to share and open the share options

Then select share this folder

If you want to setup folder access permissions, right click on the folder and open properties (See screenshot bellow)

If you want to add a password to the user: open a terminal and type the command :
sudo smbpasswd -a pirat9
and then type your password.
Now the configuration is done.
Now lets try to check if we can for example connect from a windows machine. To do that
In a windows machine go to start –>Run and type :
ip or hostname

You will be asked to insert the user and password

Check the share folder

And is done.
完
快速配置 Samba 将 Linux 目录映射为 Windows 驱动器的更多相关文章
- 快速配置 Samba 将 Linux 目录映射为 Windows 驱动器,用于跨平台编程
一.局域网内的 Linux 服务器上操作步骤: 1.安装samba(CentOS Linux): yum install samba system-config-samba samba-client ...
- NO1:安装VMLinux虚拟机,安装配置Samba实现Linux与Windows文件共享
离开技术好些年,仅凭记忆开始学习.同时决定在Linux系统学习C语言. 一.下午安装了VM 8.0,安装RedHat Enterpris Server 6.4虚拟操作系统,都还比较顺利. 二.要实现L ...
- Linux网络配置 RPM命令 samba服务 Linux目录结构
第一种方法: (1)用root身份登录,运行setup命令进入到 text mode setup utiliy对网络进行配置,这里可以进行ip,子网掩码,默认网关,dns的设置.(2)这时网卡的配置没 ...
- 快速配置Samba服务
1.安装samba 这里以CenOS 7为例,其他系统类似 yum install samba samba-client samba-common 2.修改smb.conf 最好先备份原文件,以防 ...
- 在Ubuntu14.04下配置Samba 完成linux和windows之间的文件共享
在Windows和Linux之间传递文件可以使用Samba服务.下面是安装步骤: 1. 安装Samba. sudo apt-get install samba 2. 修改配置文件 sudo gedit ...
- linux文件映射到windows(方便用虚拟机搭建linux服务器,用本地windows代码编辑)
1,安装docker: https://docs.docker.com/install/linux/docker-ce/centos/ 2,linux上创建好需要共享的目录 /data/share(可 ...
- Ubuntu 下配置Samba 实现Linux和windows之间文件共享
一 Samba 的安装: sudo apt-get insall sambasudo apt-get install smbfs 二 在Ubuntu中创建共享目录: mkdir /home/shar ...
- vmware 实现linux目录映射window本地目录
---恢复内容开始--- 背景: 1,使用lnmp环境 2,代码可以在windows上面写,直接映射到linux的lnmp环境下面 第一步: vmware 新建一个linux虚拟机 一路下一步到完成 ...
- Samba快速配置
Samba是linux,unix,windows之间进行交互操作的软件组件,Sanma是基于GPL协议的自由开源软件. 快速配置samba文件服务器 1.关闭防火墙和SELinux [root@cen ...
随机推荐
- javascript 之 location.href、跨窗口调用函数
location.href这个东西常常用于跳转,location既是window对象的属性,又是document对象的属性. JavaScript hash 属性 -- 返回URL中#符号后面的内容 ...
- Android的debug.keystore拒绝访问导致的生成异常及解决方案
构建Android应用程序的时候输出异常:[apkbuilder] keytool 错误: java.io.FileNotFoundException: C:\Users\my\.android\de ...
- C#中Split分隔字符串的应用(C#、split、分隔、字符串)
转载地址 .用字符串分隔: using System.Text.RegularExpressions; string str="aaajsbbbjsccc"; string[] s ...
- hdu 1987-How many ways(dp)
解析:假设机器人在(x,y)这个点,能量为power,那么可以到达它右下角曼哈顿距离小于等于power的地方,再以该点为起点继续搜索. 代码如下: #include<cstdio> #in ...
- 了解SQL注入攻击
SQL注入:利用现有应用程序,将(恶意)的SQL命令注入到后台数据库引擎执行的能力,这是SQL注入的标准释义. 随着B/S模式被广泛的应用,用这种模式编写应用程序的程序员也越来越多,但由于开发人员的水 ...
- 小函数,大智慧,php的isset和empty
Disset()函数 一般用来检测变量是否设置 bool isset ( mixed var [, mixed var [, ...]] ) 功能:检测变量是否设置 返回值: FALSE N ...
- EasyMonkeyDevice vs MonkeyDevice&HierarchyViewer API Mapping Matrix
1. 前言 本来这次文章的title是写成和前几篇类似的<EasyMonkeyDevice API实践全记录>,内容也打算把每一个API的实践和建议给记录下来,但后来想了下认为这样子并非最 ...
- os x 10.10 測试版系统下载 swift语言学习资料下载
http://pan.baidu.com/s/1eQ5oj1S 这是下载地址 ! 刚学完oc 就出了 swift!这---- 只是还是非常高兴看了一点swith得东西感觉 ...
- Java有用经验总结--Swing篇
Java有用经验总结--Swing篇 前言 本文前言部分为我的一些感想,假设你仅仅对本文介绍的Java有用技巧感兴趣,能够跳过前言直接看正文的内容. 本文的写作动机来源于近期接给人家帮忙写的一个小程序 ...
- 【十】注入框架RoboGuice使用:(Your First Testcase)
上一篇我们简单的介绍了一下RoboGuice的使用([九]注入框架RoboGuice使用:(Your First Injected Service and BroadcastReceiver)),今天 ...