How to do File sharing in linux . Samba server installation .

 What is samba ?

It is a protocol or an services that allow to share file between different platform or different operating system . We can use samba service  to deploy printer service also .

Details about Samba.

1. package --> Samba 

2. Port number  -->  137, 138, 139

3. Service name   --> Smb

4. Configuration file  -->  /etc/samba/smb.conf


Pre-request things 

  • Network should be configured .
  • Disable the firewall or promot samba through samba .
  • Configure Selinux for Samba shared folder or disable.

STEP 1 :-


Do in sender or server side .

  • yum install samba -y      (  Install the samba )
  • rpm -qa samba*  (  checking all file are install or not )
We have to install " samba-client " in client side . make sure don't create folder in desktop or home directory because it have strong permission so create folder under the  ( / ) folder .

STEP 2 :-

# mkdir /samba-shared  ( create file inside "  / " directory . )

open terminal and type that i am given bellow .

Now registerr the configuration file in samba config .

# vim  /etc/samba/smb.conf

( scroll down the last line and go to insert mode to add some lines that given bellow .)

[ samba-shared ]                     comment =  file shearing server ------> Anything you can add this line .

                    Path = /Samba-shared

                    browse able = Yes  -----------> For discover by the neighbours system .

                    Write able = Yes   -------------> Permission for modification. 
                    Valid users = Samba   --------->  It should be available in your system or simple username .

Now press  (  Shift + : ) and then type  (  Wq! ) for save and exit form the editor . 

Now Verify the configuration file by typing this command in terminal screen .

                                        # testparm
STEP 3 :- 

Now start the smb services in your system by pressing this commands that given bellow .

# systemctl status smb

                    # systemctl start smb 

                    # systemctl enable smb 

 STEP 4 :- 

Now create a user name samba and prompt it as Samba user .

# useradd sahoo  ------> Adding user into your pc .

          # passwd jet-123 -------> Adding password to the user .

         # smb passwd -a sahoo < Press Enter key >

Now type your samba password not your user password and create a new samba password after running this above commands .


STEP 5 :- 

  Now restart the samba server by just typing : # systemctl restart smb

Then  type  :-  smbclient -L 172.16.200.56 -u samba 

  • -L :-      That link your.
  • 172.16.16.200.56  -- my server ip address you add your own server ip address .
  •  -u  :-  User
Now add Jet123@ as password . 
            #ll
Now change the permission to continue .

            # chmod 777 /samba-shared

                                                From client side

Open your file manager and then tap on other location and then type inside server address box your samba configuration ip address like this . And after connection will done then type your Username and Password to get your file . 

                                smb://172.16.200.56  

 

 That's all about how to do samba server configuration in your pc . I hope you will got your answer . If you have any problem related to this blog or in linux system then please contact me .

 

No comments