分类: LINUX
2015-05-12 20:06:04
修改/etc/samba/smb.conf.template 文件。(添加下列部分,为了看得清楚,间距大了点。配置文件中不需要换行)
[global]
unix charset = UTF-8 //使其认识中文
security = user //认证模式为user (需要用户名和密码登陆)
map to guest = bad user //这个很关键,在user实现匿名无需交互输入用户名和密码就靠这句
guest account = nobody //匿名用户映射成nobody用户
修改/etc/config/samba 文件
config ‘sambashare’ //(此目录不需要用户名和密码即可访问)
option ‘comment’ ‘public stuff’
option ‘create_mask’ ’0700′ //这个我在页面上配置过的
option ‘dir_mask’ ’0700′ //如上
option ‘name’ ‘USB1′ //此为共享名
option ‘path’ ‘/mnt/USB1′ //此为共享的路径
option ‘read_only’ ‘yes’ //此为只读,如需读写可改为writable = yes
option ‘public’ ‘yes’
option ‘onlt guest’ ‘yes’
option ‘guest_ok’ ‘yes’
config ‘samba’ (此目录需要用户名和密码才能访问)
option ‘workgroup’ ‘openwrt’ //额,以下需要验证的资料一大把。我就不说了
option ‘description’ ‘openwrt’
option ‘enable’ ’1′
option ‘homes’ ‘/mnt/USB1′
option ‘name’ ‘MiniLinux’
option ‘optimization’ ’1′
然后运行下面命令让samba启动时自动运行:
/etc/init.d/samba enable
/etc/init.d/samba restart