linux中Samba配置
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-05-17
iyanet ~]# passwd msn Changing password for user msn. New UNIX password: BAD PASSWORD: it is WAY too short Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@aiyanet ~]# smbpasswd -a msn New SMB password: Retype new SMB password: Added user msn. 建立smbpasswd文件 [root@aiyanet ~]# vi /etc/samba/smb.conf 拥有帝国一切,皆有可能。欢迎访问phome.net101 security = user 102 passdb backend = tdbsam(验证方式)前面家“;”注销掉 添加smb passed file = /etc/samba/sampassd :wq!(保存推出); [root@aiyanet samba]# ls lmhosts passdb.tdb secrets.tdb smb.conf smbpasswd smbusers 备注(现在已经生成smbpasswd文件) a、现在可以啦!讲解一个小例题:(大家都可以访问); 让大家更容易理解; [root@aiyanet Desktop]# mkdir /xiaofu [root@aiyanet Desktop]# vi /etc/samba/smb.conf :$(命令) [xiaofu] comment = xiaofu path = /xiaofu public = yes (任何人都能够访问) [root@aiyanet Desktop]# service smb reload 重新加载:不要重启,在现实生活中一般不重启; 测试:在windows XP 的运行中\192.168.1.123xiaofu 就可以找到这个目录:OK你已经成功啦!呵呵. b、建一个要用户名才可以访问的吧! [root@aiyanet Desktop]# groupadd xiaoshou (建立组) [root@aiyanet Desktop]# useradd -g xiaoshou xiaoshou1 [root@aiyanet Desktop]# useradd -g xiaoshou xiaoshou2 [root@aiyanet Desktop]# passwd xiaoshou1 Changing password for user xiaoshou1. New UNIX password: BAD PASSWORD: it is too short Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@aiyanet Desktop]# passwd xiaoshou2 Changing password for user xiaoshou2. New UNIX password: BAD PASSWORD: it is too short 拥有帝国一切,皆有可能。欢迎访问phome.net Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@aiyanet Desktop]# smbpasswd -a xiaoshou1(添加samba用户) New SMB password: Retype new SMB password: Added user xiaoshou1. [root@aiyanet Desktop]# smbpasswd -a xiaoshou2 New SMB password: Retype new SMB password: Added user xiaoshou2. [root@aiyanet Desktop]# vi /etc/samba/smb.conf 101 security = user(注意) 102 ; passdb backend = tdbsam 103 smb passwd file = /etc/samba/smbpasswd [root@aiyanet Desktop]# vi /etc/samba/smb.conf :$(注意) [xiaoshou] comment = xiaoshou file path = /aiyanet/xiaoshou security = user valid users = @xiaoshou [root@aiyanet samba]# /etc/init.d/smb reload (重新加载) 再试试:您又成功啦!hehe 解决samba server 的安全隐患:建立虚拟账号; [root@aiyanet Desktop]# vi /etc/samba/smb.conf [root@aiyanet Desktop]# vi /etc/samba/smb.conf 74 workgroup = workgroup 75 server string = file Samba Server 76 username map = /etc/samba/smbusers [root@aiyanet ~]# vi /etc/samba/smbusers # Unix_name = SMB_name1 SMB_name2 ... 拥有帝国一切,皆有可能。欢迎访问phome.net root = administrator admin nobody = guest pcguest smbguest xiaoshou1 = msn qq xiaoshou2 = nba sina (这就是虚拟用户账号) 还有hosts deny = 禁止 hosts allow = 允 |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: linux下find用法下一篇: squid日志的分割
关于linux中Samba配置的所有评论