Samba Configuration in RHEL7



Samba Configuration in RHEL7
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 is a networking tool, it helps Linux Servers to share files, printers, and other Client utilities. Using Samba application or protocol is simple. Before you start using Samba make sure your Linux Server has TCP port 8086 for the main Samba port. It makes access to the Servers easier. Using Samba is very easy. You will first need to find the correct directory to manage files. You can check below before your start. Tutorial on Manage files on Linux using Samba Open a new terminal window type vagrant ssh Login to the Samba Console vagrant ssh Next go to your Documents and navigate to the /etc/samba directory. Now we have to set up our virtual machine for SMB Connection. First, we need to edit our /etc/samba/smb.

Samba Configuration 


SERVER:198.168.50.11

CLIENT:198.168.50.15


#yum install samba samba-client -y


Samba Configuration in RHEL7
Samba Configuration in RHEL7 


#systemctl enable smb


#systemctl start smb


Samba Configuration in RHEL7
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
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
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
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
Samba Configuration in RHEL7 



create a text file in root





Samba Configuration in RHEL7
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
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
Samba Configuration in RHEL7 


Fill credentials IP address of Server

Samba Configuration in RHEL7
Samba Configuration in RHEL7 



Samba Configuration in RHEL7
Samba Configuration in RHEL7 





Setting up printers


Setting up printers could be a very hard task and it is one of the most hated tasks for Linux users. All of the time printers are missing or they can not load after setting it to default. But now with Samba Linux can help you to easily connect to the printer. Samba, C:\SMB\SERVER\//C:\SMB.tmp Change the default directory #at /etc/samba/smb.conf Change the indexer #at /etc/samba/smb.conf Enable passwords for sharing #at /etc/samba/smb.conf Connect and check the connection #connect Check the printers #prints to Samba #printer information #printers You can get the password for Samba by the use of config command #config -h Samba does not provide the option to edit the main default.conf file manually and the document is not complete on how to manage it.




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 moreAll about Nagios Monitoring Tools

    Read more: Uses of samba server and  key features of the samba server 

    Read More: Redhat  troubleshooting interview questions











                               

Previous
Next Post »