buf

BE something YOU love and understand
posts - 94, comments - 35, trackbacks - 0, articles - 2
   :: 首页 :: 新随笔 :: 联系 ::  :: 管理

samba on Detian etch

Posted on 2009-01-05 21:39 buf 阅读(264) 评论(0)  编辑 收藏 引用 所属分类: Embedded

安装:
$ sudo apt-get install samba-common samba
安装过程中会要求输入计算机所在的工作组名,也可以在samba的配置文件再设置

配置:
直接暴露共享文件夹,没有用户和权限管理,实现Debian etch和Windows XP之间的简单文件共享
$ sudo chmod -R 777 /home/u-boot/u-boot-1.1.4
$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.orig
$ sudo vim /etc/samba/smb.conf

在[global]一节中,找到
;   security = user
改为
   security = share
然后在配置文件的最后添加要共享的项目
[u-boot]
   comment = u-boot devel
   path = /home/buf/u-boot/u-boot-1.1.4
   guest ok = yes
   writable = yes
   share modes = yes

保存退出后可以使用testparm检查samba的配置:
$ testparm

Load smb config files from /etc/samba/smb.conf
Processing section 
"[homes]"
Processing section 
"[printers]"
Processing section 
"[print$]"
Processing section 
"[u-boot]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        server 
string = %h server
        security 
= SHARE
           
[u
-boot]
        comment 
= u-boot devel
        path 
= /home/buf/u-boot/u-boot-1.1.4
        read only 
= No
        guest ok 
= Yes
最后,重新启动samba服务:
$ sudo /etc/init.d/samba restart

注意:共享的文件夹千万别写错了,我在Windows XP SP2上访问运行在同一台机器的虚拟机上debian上的samba共享时居然造成XP重启!!! 真是太神奇了。。。
只有注册用户登录后才能发表评论。