centos7 设置samba服务

超、凢脫俗 2022-05-22 13:10 315阅读 0赞

samba主要是用于在windos映射到linux。开发中这样做非常方便。

安装:yum -y install samba

备份配置文件:cp /etc/samba/smb.conf /etc/samba/smb.conf_bk

修改配置:

具体配置文件解释,可以百度。

vi /etc/samba/smb.conf

[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[root]
comment = root file
path = /root
writeable=yes
guest ok = yes
create mask = 0644
directory mode=0775
valid users=root
browseable = yes
display charset=UTF-8

  1. unix charset=UTF-8
  2. dos charset=UTF-8

保存::wq

配置文件简介:

映射的是root目录。允许写操作。创建的文件夹默认644权限,文件默认775权限。使用root用户登录。

samba使用的是tdbsam模式。所以只能使用linux 中存在的用户。这里我使用的是root 用户

设置用户密码:

smbpasswd -a root

防火墙设置:

firewall-cmd —permanent —zone=public —add-service=samba

firewall-cmd —reload

关闭Selinux:

setenforce 0

vi /etc/selinux/config

SELINUX=enforcing改为SELINUX=disabled,保存后退出

设置smb自启动:

vi /etc/re.d/rc.local

在最后添加

/bin/systemctl start smb.service

发表评论

表情:
评论列表 (有 0 条评论,315人围观)

还没有评论,来说两句吧...

相关阅读