yum install samba samba-client samba-common
vi /etc/samba/smb.conf
[global]
workgroup = EricShare
netbios name = BigFish
server string = Linux Samba Server TestServer
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[Workspace]
path = /home/eric/workspace
writeable = yes
browseable = yes
# hosts allow = 10.10.
mkdir /home/eric/workspace
smbpasswd -a Eric
iptables -F
setenforce 0 关闭SELinux服务,如果要打开则setenforce 1 (否则会出现无权限访问),为防止每次重启都要手动关闭,可在配置文件中关:
vi /etc/selinux/config
修改 SELINUX=enforcing 为 SELINUX=disabled
则开机的时候就关闭了
开启服务
service smb start;
Centos 7 关闭防火墙
systemctl stop firewalld.service
测试smb 连通性
smbclient -L 10.17.128.20 -U root%
查看共享文件的读写权限,防止主机访问不了共享文件
如没有权限,则:
chmod a+rw workspace
vi /etc/samba/smb.conf
[global]
workgroup = EricShare
netbios name = BigFish
server string = Linux Samba Server TestServer
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[Workspace]
path = /home/eric/workspace
writeable = yes
browseable = yes
# hosts allow = 10.10.
mkdir /home/eric/workspace
smbpasswd -a Eric
iptables -F
setenforce 0 关闭SELinux服务,如果要打开则setenforce 1 (否则会出现无权限访问),为防止每次重启都要手动关闭,可在配置文件中关:
vi /etc/selinux/config
修改 SELINUX=enforcing 为 SELINUX=disabled
则开机的时候就关闭了
开启服务
service smb start;
Centos 7 关闭防火墙
systemctl stop firewalld.service
测试smb 连通性
smbclient -L 10.17.128.20 -U root%
查看共享文件的读写权限,防止主机访问不了共享文件
如没有权限,则:
chmod a+rw workspace