###准备工作
查看系统信息
[root@localhost ~]# cat /etc/redhat-release
查看yum源中SAMBA版本
[root@localhost ~]# yum list | grep samba
查看CentOS7IP地址
[root@localhost ~]# ifconfig
或者
[root@localhost ~]# ip address
关闭防火墙及关闭防火墙开机自启
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
永久关闭SeLinux,需要重启机器
修改配置文件/etc/selinux/config,将SELINU置为disabled
具体过程忽略
安装Samba服务
在可以联网的机器上使用yum工具安装,如果未联网,则挂载系统光盘进行安装。
yum -y install samba samba-client
有依赖关系的包samba-common、samba-winbind-clients、libsmbclient将自动安装上去。
配置Samba服务
[root@aws10011 ~]# vi /etc/samba/smb.conf
增加如下内容
[nas10011]
comment = Home Directories
browseable = yes
writable = yes
valid users = awshare
path = /awdisk10011/nas
添加用户
[root@aws10011 ~]# useradd -u 1000 awshare
[root@aws10011 ~]# smbpasswd -a awshare
启动服务
[root@aws10011 ~]# systemctl restart smb
[root@aws10011 ~]# systemctl restart nmb
[root@aws10011 ~]# systemctl enable nmb
Created symlink from /etc/systemd/system/multi-user.target.wants/nmb.service to /usr/lib/systemd/system/nmb.service.
[root@aws10011 ~]# systemctl enable smb
Created symlink from /etc/systemd/system/multi-user.target.wants/smb.service to /usr/lib/systemd/system/smb.service.
CentOS 7下Samba服务器的安装与配置
https://www.cnblogs.com/muscleape/p/6385583.html
CentOS 7下Samba服务安装与配置详解
https://www.linuxidc.com/Linux/2017-11/148354.htm
文档更新时间: 2019-09-10 06:56 作者:月影鹏鹏