• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to Install and configure samba share on CentOS8.1

  • 00:48 yum install samba -y
  • 01:21 systemctl enable smb
  • 02:10 adduser --system system shareuser
  • 03:11 chown -R shareuser1 /value
  • 03:52 chcon -Rt samba_share_t
  • 09:11 smbpasswd -e shareuser1
6358

How to Install and configure samba share on CentOS8.1

Introduction:

Samba is a tool which helps its users to share files and printer to SMB/CIFS clients from a Linux server/desktop, which you can even connect to a Windows Domain. This tutorial will show you the method on how to install samba on CentOS8

Installation process:

First install Samba4 and required packages from the default CentOS repositories using the yum package manager tool.

 linuxhelp user #yum  install samba -y

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libsmbclient libwbclient0 python-dnspython python-ldb python-samba python-tdb samba-common
…….
Setting up samba-common-bin (2:4.3.11+dfsg-0ubuntu0.16.04.12) ...
Setting up samba (2:4.3.11+dfsg-0ubuntu0.16.04.12) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...

You should now check the status of Samba service by running the following command.

linuxhelp user # systemctl status smbd
● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
   Loaded: loaded (/etc/init.d/smbd  bad  vendor preset: enabled)
   Active: active (running) since Wed 2018-03-07 16:38:06 IST  27s ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/smbd.service
           ├─15577 /usr/sbin/smbd -D
           ├─15580 /usr/sbin/smbd -D
           └─15583 /usr/sbin/smbd -D

Mar 07 16:38:05 linuxhelp systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
Mar 07 16:38:06 linuxhelp smbd[15561]:  * Starting SMB/CIFS daemon smbd
Mar 07 16:38:06 linuxhelp smbd[15561]:    ...done.
Mar 07 16:38:06 linuxhelp systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd).

Once its done, you need to run these commands to create a Directory.

Create two directries for share

linuxhelp user # mkdir /data
linuxhelp user # mkdir /value

In order to change ownership of file and directories to run the below commands.

linuxhelp user # chown   -R  shareuser /data
linuxhelp user # chown -R shareuser1 /value

And you need to create new user as follows.

linuxhelp user # adduser –system shareuser
linuxhelp user # adduser –system shareuser1

And add those users to Samba service

linuxhelp user # smbpasswd -a shareuser
New SMB password:
Retype new SMB password:
Added user user1.

Create password for another user

linuxhelp user # smbpasswd  -a shareuser1
New SMB password:
Retype new SMB password:
Added user user2.

Now, open Samba configuration file.

linuxhelp user # vim /etc/samba/smb.conf

And add the following line in the end of the file

[share1]
path = /data
valid users = shareuser
read list = shareuser
write list = shareuser
browsable = yes
invalid users = shareuser1
[share2]
path = /value
valid users = shareuser1
read list = shareuser1
write list = shareuser1
browsable = yes
invalid users = shareuser

Now restart samba service linuxhelp user # systemctl restart smbd

Also, make sure you check the IP address.

linuxhelp user # ip a s
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens33: < BROADCAST,MULTICAST,UP,LOWER_UP>  mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ether 00:0c:29:2c:09:18 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.235/24 brd 192.168.7.255 scope global ens33
       valid_lft forever preferred_lft forever

Now move to the client pc. Open windows explorer and give you samba share link snap1 Now open your share snap2 Clear the network cache before going to another user snap3 Change to different user snap4 With this, the method to install and configure Samba share on CentOS 8 comes to an end.

Tags:
sebastian
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

Is there any other command? for adding users into a group but without deleting the old users in that group?

A

execute command "useradd -a -G group_name user_name".

Q

How to list samba users?

A

Use the command to list the samba users as "sudo pdbedit -L -v"

Q

What is the configuration file for samba?

A

it is /etc/samba/smb.conf.

Q

How will you verify that your smb.conf file doesn't have any mistakes and misspellings?

A

"testparm" tool that verifies the syntax of a configuration file(smb.conf).testparm s smb.conf

Q

How to start and stop the samba server?

A

/etc/init.d/smb restart
OR service smb restart

Load more

Related Tutorials in How to Install and configure samba share on CentOS8.1

Related Tutorials in How to Install and configure samba share on CentOS8.1

How To Install AnyDesk on Centos 7
How To Install AnyDesk on Centos 7
Apr 2, 2018
How to install Tiki Wiki CMS Groupware on CentOS 7
How to install Tiki Wiki CMS Groupware on CentOS 7
May 31, 2018
How to install PHP ImageMagick on CentOS 7
How to install PHP ImageMagick on CentOS 7
Nov 4, 2017
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
Jun 4, 2019
How to install Apache from Source Code on CentOS 7
How to install Apache from Source Code on CentOS 7
Oct 21, 2017
How to enable or disable repositories in CentOS
How to enable or disable repositories in CentOS
Mar 28, 2018
How to install AWStats on CentOS 7
How to install AWStats on CentOS 7
Dec 8, 2017
How to install Apache JMeter in CentOS 7
How to install Apache JMeter in CentOS 7
Mar 24, 2017

Related Forums in How to Install and configure samba share on CentOS8.1

Related Forums in How to Install and configure samba share on CentOS8.1

CentOS
connor class=
How To Completely Remove Apache package On CentOS 7.6
May 14, 2019
Linux
stephan class=
How to list all samba users
Jan 12, 2018
CentOS
ceriaimmaculate class=
setfacl : command not found
Jan 3, 2018
Samba
noah class=
How to reset SAMBA user password
Sep 6, 2017
CentOS
mason class=
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)
Nov 20, 2018
CentOS
landon class=
Command to find SNMP Version
May 28, 2018
CentOS
arjitharon class=
cannot start minio service help
Mar 10, 2018
Apache tomcat
AadrikaAnshu class=
Cannot find ./catalina.sh The file is absent or does not have execute permission This file is needed to run this program
Jun 17, 2019

Related News in How to Install and configure samba share on CentOS8.1

Related News in How to Install and configure samba share on CentOS8.1

Samba vulnerability calls to mind WannaCry fears to Linux/ UNIX
Samba vulnerability calls to mind WannaCry fears to Linux/ UNIX
May 30, 2017
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help keel johnston ?
Unhide the folders on windows Explorer

Give any solutions to unhide folder using command prompt?

forum3

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.