[文章作者:张宴 本文版本:v1.0 最后修改:2011.04.08 转载请注明原文链接:http://blog.zyan.cc/samba_linux_windows/]

  一、局域网内的 Linux 服务器上操作步骤:

  1、安装samba(CentOS Linux):
yum install samba system-config-samba samba-client samba-common


  2、创建www账号
/usr/sbin/groupadd 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配置文件
mv -f /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.conf

  输入以下内容:
引用
[global]
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 www
smbpasswd -a root


  5、启动samba:
/sbin/service smb start




  二、局域网内的 Windows 服务器上操作步骤:

  1、Windows 上访问 samba,在“我的电脑”中输入:
\\xxx.xxx.xxx.xxx\


  2、Windows 断开 samba 共享连接,在【开始】→【运行】→【cmd】回车中输入:
net use * /del


  3、将 samba 共享的 Linux 目录,映射成 Windows 的一个驱动器盘符:

  点击在新窗口中浏览此图片

  点击在新窗口中浏览此图片

  点击在新窗口中浏览此图片



  三、跨平台C/C++代码编译、调试:

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

  点击在新窗口中浏览此图片

  点击在新窗口中浏览此图片

  注意:在samba共享的驱动器上执行“.bat”批处理脚本,会导致 Windows 蓝屏,这一点需要注意。


Tags: , ,



技术大类 » 其他Unix技术 | 评论(58) | 引用(0) | 阅读(100052)
cheap designer sunglasses
2012-6-29 15:18
If you want a high quality pair of cheap sunglasses, Designer wholesale sunglasses are your best options. You now have the opportunity to select from one of our many wholesale sunglasses.These sunglasses are the highest in quality and fashion.If you are looking for the hottest new sunglass styles please visit our wholesale designer sunglasses web site and let us show you why we are the industries leader!
lirourou77 Email Homepage
2012-9-5 13:09
in a new mechanism of system to replace the old in medicine have medical mechanism, which is the cheap designer handbags      
cattle nets", and click "online voting" found that, the original vote is paid, 1 yuan 1 ticket.

"If you have to vote online, by pay treasure, net silver or cell phone pays fee." HeXianSheng cheap designer clothes        
said, let people will choose the doctors like this is a good thing, but if will pay it is stale, "so, mean who's money, who can election?"

【 operation 】 can buy tickets into batch quantity
discount designer handbags        

According to HeXianSheng provide web site, reporter found "purple cattle nets", "popular activities" column in the article 1 is
Coach Email Homepage
2012-11-3 14:35
"The Coach Outletengines that will likely power the J-31 we do know a bit mor.Coach Outlet  Those engines were actually revealed at the Zhuhai showCoach Outlet in 2008," Fisher said referring to an annual China air show. He beCoach Outletlieves the new J-31 engine is undergoing preliminary
1314it Email Homepage
2012-12-11 11:27
张兄,文章不错,有2个地方可以简单优化下。net use * /del可以优化为net use * /del /y  (强制卸载,不提示。)添加驱动器步骤较多,可以优化成命令。net use x: 192.168.8.51\knose "password" /user:username
lanctly Email
2013-4-24 15:59
WizToner.com is a professional Toner Cartridge Manufacturer and Toner Cartridge Supplier in china, offering the fine quality Toner Cartridge Manufacturer & Remanufactured and excellent service to our clients.
海阔天空 Homepage
2013-5-13 20:31
海阔天空俏佳人娱乐会所15026982229 小姐服务24小时出差旅游大学生兼职按摩小姐上门,处女开红,兼职空姐,,白俄罗斯小姐,兼职模特,性感少妇全国连锁,就近提供北京、上海、广州等地姐兼职美女上门保健按摩北京小姐上门,上海兼职美眉,广州美女上门保健按摩,西安女大学生兼职,重庆空姐兼职,杭州酒店宾馆美女,温州兼职美女,南京白领兼职,全国本地找小姐上门按摩,模特私拍,援助交际更多请进 www.lvcai.org 查看
磨延城 Email Homepage
2013-10-21 18:04
磨途歌学习了,先做个记号,以后肯定用得上,老师辛苦了
forthxu Homepage
2013-11-9 10:52
附加,需要开启的端口:                   1)Port 137 (UDP) - NetBIOS 名字服务 ; nmbd\                  2)Port 138 (UDP) - NetBIOS 数据报服务                  3)Port 139 (TCP) - 文件和打印共享 ; smbd (基于SMB(Server Message Block)协议,主要在局域网中使用,文件共享协议)                           4)Port 389 (TCP) - 用于 LDAP (Active Directory Mode)                              5)Port 445 (TCP) - NetBIOS服务在windos 2000及以后版本使用此端口, (Common Internet File System,CIFS,它是SMB协议扩展到Internet后,实现Internet文件共享)                                                       6)Port 901 (TCP) - 用于 SWAT,用于网页管理Samba
11
2014-2-25 14:15
Great blog. All posts have something to learn. Your work is very good and i appreciate you and hopping for some more informative posts.
IDRpoker.com Agen Texas Poker Online Indonesia Terpercaya | IDRpoker.com Agen Texas Poker Online Indonesia Terpercaya | Alfamart official partner merchandise FIFA piala dunia Brazil 2014
tony
2014-12-23 17:05
感谢大牛,感谢张哥。
Steven Email Homepage
2015-3-19 02:24
Thank you for this post Weight Loss Tea
steven Email Homepage
2015-3-20 05:32
应用公园 Homepage
2015-11-27 15:16
应用公园提供的是一种app制作服务,也就是说用户通过应用公园可以自行制作APP,根据自身的需求,选择合适的模板添加素材,就可制作出一个专业的且可是运营的手机app,还可以通过后台对应用内容进行管理。
创辉围栏厂 Email
2018-11-8 22:08
请问老大,我购买的linux系统的阿里云ECS服务器如何创建多个ftp账号和密码?我想配置多个网站,zanwww.chinaweilan.cn
pikachu88 Email
2019-1-7 10:32
Thank you for providing this interesting and very interesting topic information. I will regularly update your next articles. vex 3
dfsdfs Email Homepage
2021-5-5 09:40
Ahh that is great thank you ! Good for  special needs too !  wuxiaworld
分页: 3/3 第一页 上页 1 2 3 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]