Samba Configuration in RHEL7 |
Samba Configuration in RHEL7 Step by Step
What is samba?
It is a server message block(SMB) is the standard file sharing protocol for Microsoft windows and clients.
Samba is a networking Tool it helps Linux servers to Communicate to Windows Servers. It helps to share files, printers and other Client utilities.
It is a Free and Open Source Software, It enables Sharing with SMB and CIFS(common internet file system) client
The Samba Server Configuration Tool is a graphical interface for managing Samba shares, users, and basic server settings. It modifies the configuration files in the /etc/samba/smb.conf directory.
Samba Configuration
SERVER:198.168.50.11
CLIENT:198.168.50.15
#yum install samba samba-client -y
Samba Configuration in RHEL7 |
#systemctl enable smb
#systemctl start smb
Samba Configuration in RHEL7 |
#firewall-cmd --permanent --add-service=samba
#firewall-cmd --rel
#mkdir /groupdir
#mkdir /data
#chmod 777 /groupdir
#chmod 777 /data
#semanage fcontext -a -t samba_share_t "/groupdir(/.*)?"
#semanage fcontext -a -t samba_share_t "/data(/.*)?"
Restorecon command in linux used to Restore SELinux Context
#restorecon -RvF /groupdir
#restorecon -RvF /data
#ls -Zd /groupdir
#ls -Zd /data
Samba Configuration in RHEL7 |
#useradd -s /sbin/nologin vikram
#useradd -s /sbin/nologin tom
#useradd -s /sbin/nologin gaurav
#smbpasswd -a vikram
#smbpasswd -a tom
#smbpasswd -a gaurav
Samba Configuration in RHEL7 |
Edit samba conf file
#vim /etc/samba/smb.conf
[common]
path= /groupdir
browseable= yes
valid user= vikram
hosts allow= 192.168.50.
read list=vikram
[data]
path= /data
browseable=yes
public = yes
guest ok = no //user needs a password
valid users= tom,gaurav public //accessible users
hosts allow= 192.168.50.
writable= yes
write list=tom
Samba Configuration in RHEL7 |
#systemctl restart smb
Give a full permission to tom
#setfacl -m u:tom:rwx /data
#smbclient //192.168.50.11/common -U vikram (try to make file or directory )
It will deny access
#smbclient //192.168.50.11/data -U tom
#smbclient> mkdir info
The Directory will be created
Client configuration in the client machine
#yum install samba-client cifs-utils -y
Samba Configuration in RHEL7 |
create a text file in root
Samba Configuration in RHEL7 |
vim /root/abc.txt
username=gaurav
password=redhat
now create a directory to mount
#mkdir /mnt/multi
#chmod 777 /mnt/multi
vim /etc/fstab
//192.168.50.11/data /mnt/multi cifs creds=/root/abc.txt,sec=ntlmssp 0 0
Samba Configuration in RHEL7 |
#mount -a
#df -h
#cd /mnt/multi
#ls
#info (file is showing which is created by tom user)
Connect to windows os
Open my computer map a drive
Samba Configuration in RHEL7 |
Fill credentials IP address of Server
Samba Configuration in RHEL7 |
Samba Configuration in RHEL7 |
Setting up printers
Conclusion
In the following, we will find all the articles about Samba. Samba configuration Samba Server Samba Network Management How to Manage Samba on Linux? In this step, we will create a new Samba Server, which will create a Windows Server 2012 connection. 1. Login into the server, we will start the server and check the configuration, if the server is running. 2. You will see this in the output. We are adding users and create a temp directory to the samba share. 3. To create a connection, you will need a user and a password. 4. Use the superuser and the password, so you can make any changes. 5. We will use Wireshark to make the connections to a Windows Server.
That's all Thank you
Read more: String function in python
Read more: Python List sort() Method
Read more: All about Nagios Monitoring Tools
Read more: Uses of samba server and key features of the samba server
Read More: Redhat troubleshooting interview questions