编程知识 cdmana.com

Installation and configuration of samba server in CentOS 8

1 First, look at it through the command samba Installation of rpm -ql | grep samba
centos 8 install Samba Server and configuration
see centos edition
[root@localhost ~]# rpm -q centos-release
centos-release-8.1-1.1911.0.8.el8.x86_64
2 Online installation samba The server yum -y install samba




centos 8 install Samba Server and configuration
3 see samba Service profile
root@localhost ~]# gedit /etc/samba/smb.conf
The contents of the configuration file are as follows


[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
4 Turn off the core protection and firewall function of the system
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl stop firewalld
setenforce 0  (PS: This is off SELinux service , If you want to open it setenforce 1) 
vi /etc/sysconfig/selinux Change the line inside to SELINUX=disabled Turn off firewall






























5 Check whether the service is started ( Check whether the port number is on )
[root@localhost ~]# netstat -antp | grep -E "139|445"

centos 8 install Samba Server and configuration
6 stay /home/ Create folder A and shared
[root@localhost ~]# mkdir A
[root@localhost ~]# mkdir shared


7 Change folder A and shared Permission is 777( Any user can read, write, and execute )
[root@localhost ~]# chmod 777 A
[root@localhost ~]#chmod 777 shared

8 Add two accounts wjy,syj
[root@localhost ~]#useradd wjy
[root@localhost ~]#useradd syj

9 by wjy, and syj establish samba password
[root@localhost ~]#smbpasswd -a wjy
[root@localhost ~]#smbpasswd -a syj
centos 8 install Samba Server and configuration
There's another way to create samba How to open an account
pdbedit -a System users
[root@localhost ~]#pdbedit -a wjy
[root@localhost ~]#pdbedit -a syj






10 see ip Address
[root@localhost~]#ifconfig
centos 8 install Samba Server and configuration
11 change /etc/samba/smb.conf You can copy and paste ,[root@localhost~] sudo gedit /etc/samba/smb.conf


[global]
workgroup = WorkGroup
security = user
passdb backend = tdbsam
map to guest = bad user
[ Public documents ]
comment = Public documents
browseable=yes
path = /home/A
guest ok = yes








[ personal ]
comment = personal
path = /home/shared
browseable=yes
create mask=0644
directory mask=0755
valid users=wjy
write list=wjy






[ Group ]
comment = Group
path = /home/shared
browseable=yes
create mask=0644
directory mask=0755
valid users=syj,wjy
write list=syj,wjy
12 Turn on samba Service or restart samba
[root@localhost ~]# systemctl start smb
[root@localhost ~]# systemctl restart smb
centos 8 install Samba Server and configuration
13 Test method as in another article Ubuntu 20.04.1 install Samba The server and configuration are the same
centos 8 install Samba Server and configuration
centos 8 install Samba Server and configuration













版权声明
本文为[osc_ vpxa23em]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201224123751370E.html

Scroll to Top