Debian 7下配置samba和Windows8共享

http://blog.csdn.net/joogle/article/details/17475611

  1. apt-get install samba 安装samba

  2. smbpasswd -a infly增加共享用的用户infly,按照提示输入密码

     

  3. vi /etc/samba/smb.conf 编辑配置

    3.1 去掉security = user前边的注释

    3.2 增加

         [debian]

    path = /opt/share

    valid users = infly

    public = no

    writable = yes

    read only = no

     

      4.  重启samba

            /etc/init.d/samba restart

      

      写配置文件时候可以用testparm命令检查配置文件语法是否正确

      注:infly已经是我debian系统中的一个用户名。若smbpasswd -a test,增加samba用户不是系统中的用户名,会出现提示Failed to add entry for user

[root@debian~]# smbpasswd -a test
New SMB password:
Retype new SMB password:
Failed to add entry for user test.


解决办法:
这是因为没有加相应的系统账号,所以会提示Failed to add entry for user的错误,只需增加相应的系统账号test就可以了:
[root@debian~]# groupadd test -g 6000
[root@debian~]# useradd test -u 6000 -g 6000 -s /sbin/nologin -d /dev/null


这时就可以用smbpasswd -a test增加test这个samba账号了!为了增加系统的安全性,所以加的系统账号不要给shell它,也不给它指定目录,到时在/home目录给test账号建个文件夹,该文件夹只有test有读写权限即可!
如:
[root@debian~]# mkdir /home/test
[root@debian~]# chown -R test:test /home/test


若不想让另人访问,只让test用户可以访问,只需执行命令:
[root@debian~]# chmod u+rwx,g+rwx,o-rwx /home/test


这时可以用smbpasswd命令增加samba账号test了
[root@debian~]# smbpasswd -a test
New SMB password:
Retype new SMB password:
Added user test.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值