Linux 中 Samba 部署
原创
©著作权归作者所有:来自51CTO博客作者冷影玺的原创作品,请联系作者获取转载授权,否则将追究法律责任
安装samba软件包:
[root@w ~]# yum install samba -y
创建系统用户:
配置samba共享文件smb.conf:
[root@w ~]# vim /etc/samba/smb.conf
#最后一行添加
[www]
comment = shared
path = /home/www
writeable = yes
public = yes
添加samba账户设置密码:
[root@w ~]# smbpasswd -a www
New SMB password:
Retype new SMB password:
Added user www.
[root@w ~]#
关闭防火墙及网络状态:
[root@w ~]# systemctl stop firewalld
[root@w ~]# setenforce 0
[root@w ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are
protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@w ~]#
重启samba服务:
[root@w ~]# systemctl restart smb
主机win+R输入服务地址进行连接:
输入刚才设置的账号密码进行查看www账号的共享目录: