Fedora-29-安装-配置-搭建-samba-smb

#安装服务
dnf install smaba smb-client  -y

#启动服务,设置开机自动启动
systemctl start smb
systemctl enable smb
#设置防火墙
firewall-cmd --add-service=samba --permanent
firewall-cmd --add-service=samba
firewall-cmd --add-service=samba-client --permanent
firewall-cmd --add-service=samba-client

#添加用户 设置密码为123123
useraddl test
smbpasswd -a test
#连接
smbclient //127.0.0.1/test -U test%123123

#关闭selinux
setenforce 0

#如果selinux不关闭 设置如下
setsebool -P samba_enable_home_dirs 1
setsebool -P use_samba_home_dirs 1
setsebool -P samba_export_all_ro 1
setsebool -P samba_export_all_rw 1

#guest user
#匿名用户可读可写
vim /etc/samba/smb.conf

[public]
        comment = Public Stuff
        path = /home/public
        public = yes
        writable = yes
        browseable = Yes
        printable = no
        create mask = 0755
        guest ok = yes
        read only = No
        security = share

chmod 777 /home/public

##################################
NT_STATUS_ACCESS_DENIED making remote directory \

/home/public

chmod 777 /home/public