win10 and centos7
1.install Samba
yum install -samba*
systemctl status smb
2.configure Samba
(backup smb.conf)
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
edit smb.conf:
[global]
workgroup = WORKGROUP
server string = Ted Samba Server %v
netbios name = TedSamba
security = user
map to guest = Bad User
passdb backend = tdbsam
[Faraway]
comment = project development directory
path = /data
valid users = ted
write list = ted
printable = no
create mask = 0644
directory mask = 0755
3.configure limits.conf
nano /etc/security/limits.conf
(add parameter)
* soft nofile 65535
* hard nofile 65535
4.Create group and user
groupadd co3
useradd ted -g co3 -s /sbin/nologin #add user ‘ted’ to co3 group
smbpasswd -a ted #add user ‘ted’ to smb,need password
chown ted:co3 /data/
5.close Selinux,firewall,iptables
vim /etc/selinux/config #SELINUX=disabled
systemctl stop firewalld
systemctl disable firewalld
systemctl stop iptables
systemctl disable iptables
6.smb status
systemctl restart smb
systemctl enable smb
systemctl status smb
7.Samba ports:
1)Port 137 (UDP) – NetBIOS 名字服务 ; nmbd
2)Port 138 (UDP) – NetBIOS 数据报服务
3)Port 139 (TCP) – 文件和打印共享 ; smbd (基于SMB(Server Message Block)协议,主要在局域网中使用,文件共享协议)
4)Port 389 (TCP) – 用于 LDAP (Active Directory Mode)
5)Port 445 (TCP) – NetBIOS服务在windos 2000及以后版本使用此端口, (Common Internet File System,CIFS,它是SMB协议扩展到Internet后,实现Internet文件共享)
6)Port 901 (TCP) – 用于 SWAT,用于网页管理Samba
Refer to:
https://www.centoschina.cn/server/ftp/10826.html
https://www.linuxidc.com/Linux/2017-03/141390.htm