Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»How to Create Network Share via Samba on Linux

    How to Create Network Share via Samba on Linux

    By RahulJanuary 6, 20182 Mins Read

    Samba is an SMB/CIFS networking protocol is used for providing file and print services for Microsoft clients. Samba also can be used as part of Active Directory domain. Samba uses TCP/IP protocol for communication.
    I am using CentOS 6.3 for below installation instructions, But below steps will also work on CentOS 5 as well.

    Advertisement

    Step 1 – Install Samba

    sudo yum install samba       ## CentOS and Redhat systems 
    sudo dnf install samba       ## Fedora 22+ systems 
    sudo apt install samba       ## Debian based systems 
    

    Step 2 – Create Account for Authentication

    Now create a system account for authentication to access samba shares.

    useradd marc
    passwd marc
    

    Also add this account in smbpasswd file to be used by samba authentication.

    smbpasswd -a marc
    

    Step 3 – Configure Share Directory

    Now you will required a directory to be access with samba.

    mkdir /opt/shared
    

    Add below entry in Samba configuration file /etc/samba/smb.conf at the bottom.

    [shared]
    comment = Public Stuff
    path = /opt/shared
    public = yes
    writable = yes
    valid users = marc
    write list = marc
    

    Step 4 – Restart Samba Service

    Restart smb and nmb services of your system.

    systemctl restart smbd.service
    systemctl restart nmbd.service
    

    Step 5 – Access Samba Share

    To test your setup, you need to access shared location from windows system. Open run window on your Windows operating system and type below.

    //192.168.1.90/publicshare/
    

    Change IP with your samba server IP address. If will prompt for authentication. To authorize use account created in
    step 2.

    nmb samba smb smb.conf smbpasswd
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    An Introduction to the “./configure” Command: Compiling Source Code in Linux

    Getting Started with Linux Command line: The Beginning

    Backing Up Your Linux System with Rsync: A Step-by-Step Guide

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.