centos7.4安装samba服务
- 系统平台 CentOS Linux release 7.4.1708 (Core)
- 关闭防火墙,selinux
- 安装 samba-4.6.2-8.el7.x86_64 samba-client-4.6.2-8.el7.x86_64
- 配置/etc/samba/smb.conf
- 创建共享目录,本地目录权限和共享权限
- 创建系统用户与共享用户的密码
- 启动 smb.service
- 客户端访问共享服务器
[[email protected] ~]# cat /etc/redhat-release
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] samba]# systemctl disable firewalld.service
[[email protected] ~]# sed -i ‘[email protected][email protected][email protected]‘ /etc/selinux/config
[[email protected] samba]# setenforce 0
[[email protected] samba]# yum install samba samba-client -y
[[email protected] samba]# cd /etc/samba/
[[email protected] samba]# cp smb.conf smb.conf.bak
[[email protected] samba]# vim smb.conf
[global]
workgroup = workgroup
security = user
passdb backend = tdbsam
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
[shared]
comment = This is a directory of shared
path = /shared
valid users = zs
browseable = yes
read only = yes
[[email protected] samba]# mkdir /shared
[[email protected] samba]# echo "shared" > /shared/1.txt
[[email protected] samba]# chmod 777 /shared/
[[email protected] samba]# useradd -s /sbin/nologin zs
[[email protected] samba]# chown -R zs:zs /shared/
[[email protected] samba]# smbpasswd -a zs
[[email protected] samba]# systemctl start smb.service
[[email protected] samba]# netstat -tlnp |grep smb
windows客户端访问samba服务器ip
原文地址:http://blog.51cto.com/13480443/2092671
时间: 2024-11-08 01:21:04