创建了一个组:smbgrp 和用户srijan通过认证来访问Samba服务器。

groupadd smbgrp

useradd srijan -G smbgrp

smbpasswd -a srijan

[root@server1 samba]# smbpasswd -a srijan

New SMB password:<--yoursambapasswordRetype new SMB password:<--yoursambapasswordAdded user srijan.

[root@server1 samba]#

现在在Samba文件夹下创建一个文件夹:Secured ,并且给出权限:

mkdir -p /samba/secured

同样的,我们允许Selinux来监听:

cd /samba

chmod -R 0777 secured/

chcon -t samba_share_t secured/

再次编辑配置文件:

vi /etc/samba/smb.conf

[...]

[secured]

path = /samba/secured

valid users = @smbgrp

guest ok = no

writable = yes

browsable = yes

systemctl restart smb.service

systemctl restart nmb.service

像下面这样测试:

testparm

[root@server1 samba]# testparm

Load smb config files from /etc/samba/smb.conf

rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)

Processing section "[Anonymous]"

Processing section "[secured]"

Loaded services file OK.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions <--ENTER[global]

netbios name = CENTOS

server string = Samba Server %v

map to guest = Bad User

dns proxy = No

idmap config * : backend = tdb

[Anonymous]

path = /samba/anonymous

read only = No

guest ok = Yes

[secured]

path = /samba/secured

valid users = @smbgrp

read only = No

[root@server1 samba]#

现在在windows机器中可以使用相应的凭证来查看文件夹。

你的用户srijan同样面对着写入权限的问题,让我们来给出权限:

cd /samba

chown -R srijan:smbgrp secured/

现在Samba用户在共享的目录中有写入的权限了,开始High吧.

注:

如果你的 chcon命令不成功,请按下面的方式尝试:

chcon -h system_u:object_r:forderA  /path/to/B

Centos7 Samba 独立账户的更多相关文章

  1. Centos7 -samba服务配置

    Centos7 -samba服务配置 https://blog.csdn.net/zh515858237/article/details/76914905 http://blog.51cto.com/ ...

  2. Centos7 Samba共享服务搭建

    Centos7 Samba共享服务搭建 1.安装启动和端口 ---------------------------------------------------------------------- ...

  3. centos7 samba配置完成后不管怎么登陆都会显示密码错误的解决方案

    添加系统用户 useradd samba 添加samba用户 smbpasswd -a samba 激活samba用户 smbpasswd -e samba 1.win+r运行secpol.msc打开 ...

  4. Centos7 samba 匿名共享 简单config

    安装Samba yum install samba samba-client samba-common -y 备份原始的Samba配置文件: mv /etc/samba/smb.conf /etc/s ...

  5. centos7 samba安装教程

    samba的用途:有的时候,我们需要在centos7 的文件能共享给其他机器. rpm -qa|grep samba yum install -y samba setenforce 0 sed -i ...

  6. centos7 samba匿名访问设置

    [global] workgroup = WORKGROUP server string = Samba Server %v netbios name = centos security = user ...

  7. centos7 samba安装

    http://www.cnblogs.com/muscleape/p/6385583.html 1 安装yum install samba 2 添加用户xxx smbpasswd -a xxx 3 s ...

  8. centos7 samba安装与配置

    1.关闭防火墙. CentOS 7 是自带的firewall,CentOS 6 好像是iptables.关闭防火墙命令如下: 第一种方法是关闭防火墙: systemctl disable firewa ...

  9. Centos7 samba配置

    目录 免密码只读 加密码可读写 Samba配置了很多次,总是忘,现在写在博客里. 免密码只读 最主要的是免密配置,主要用到了两个配置,要写在[global]里: map to guest = Bad ...

随机推荐

  1. 搜索 || BFS || POJ 3278 Catch That Cow

    农夫在x位置,下一秒可以到x-1, x+1, 2x,问最少多少步可以到k *解法:最少步数bfs 要注意的细节蛮多的,写在注释里了 #include <iostream> #include ...

  2. Selenium3+python自动化008-操作浏览器基本方法

    一.打开网站1.第一步:从selenium里面导入webdriver模块2.打开Firefox浏览器(Ie和Chrome对应下面的)3.打开百度网址二.页面刷新1.有时候页面操作后,数据可能没及时同步 ...

  3. 使用 Pytorch 实现 skip-gram 的 word2vec

    转载请注明 AIQ - 最专业的机器学习大数据社区  http://www.6aiq.com AIQ 机器学习大数据 知乎专栏 点击关注 链接地址: https://github.com/lonePa ...

  4. ios 自定义delegate(一)

    在自定义协议的头文件 .h中 @protocol NSDelegate <NSObject>@optional  //可选 - (void)OnOption:(NSString *)pSt ...

  5. [LOJ] 分块九题 3

    https://loj.ac/problem/6279 区间修改,区间查询前驱. TLE无数,我觉得这代码最精髓的就是block=1000. 谜一样的1000. 两个启示: 块内可以维护数据结构,比如 ...

  6. php 后端规范

    后端框架地址: git@gitee.com:xielisen/xcore.git 框架使用规范,内部沟通 Controller命名规范 1, 首字母大写,其余小写 2, 对应数据库名称. 不要下划线 ...

  7. Python运维工程师

    1.单引号,双引号,三引号的区别. 2.Python里面如何实现tuple和List的转换. 3.Python的参数传递是值传递还是引用传递,举例说明Python函数参数传递的几种形式,并说明函数传参 ...

  8. centos7 ftp 500 OOPS: cannot change directory:/var/ftp/xutong/

    在设置多用户登录的时候 该指定的用户xutong对于上级目录/var/ftp 没有访问权限 修改一下上级目录的权限 chmod /var/ftp 对于ftp多用户访问的配置修改也做一个记录 以是设置F ...

  9. POJ 1201 Intervals(差分约束 区间约束模版)

    关于差分约束详情可阅读:http://www.cppblog.com/menjitianya/archive/2015/11/19/212292.html 题意: 给定n个区间[L,R], 每个区间至 ...

  10. Spring异常——BeanNotOfRequiredTypeException

    使用junit测试ssh搭建的框架的时候,遇到了一个异常: 异常消息: org.springframework.beans.factory.BeanCreationException: Error c ...