Diff for "How to Create a Network Share Via Samba Via CLI (Command-line interface/Linux Terminal) - Uncomplicated, Simple and Brief Way!"


Differences between revisions 2 and 3
Revision 2 as of 2013-05-01 15:44:04
Size: 2781
Editor: 200-101-118-14
Comment:
Revision 3 as of 2013-05-01 16:14:41
Size: 2781
Editor: 200-101-118-14
Comment:
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
smbpasswd-a <USERNAME> smbpasswd-a <user_name>
Line 29: Line 29:
mkdir /home/<USERNAME>/<folder_name> mkdir /home/<user_name>/<folder_name>
Line 46: Line 46:
path = / home / <USERNAME> / <folder_name> path = /home/<user_name>/<folder_name>
Line 48: Line 48:
valid users = <USERNAME> valid users = <user_name>
Line 70: Line 70:
      To access your network share use your username (<USERNAME>) and password through the path "smb://<HOST_IP_OR_NAME>/<folder_name>/" (Linux users) or "\\<HOST_IP_OR_NAME>\<folder_name>\" (Windows users). Note that "<folder_name>" value is passed in "[<folder_name>]", in other words, the share name you entered in "/etc/samba/smb.conf".       To access your network share use your username (<user_name>) and password through the path "smb://<HOST_IP_OR_NAME>/<folder_name>/" (Linux users) or "\\<HOST_IP_OR_NAME>\<folder_name>\" (Windows users). Note that "<folder_name>" value is passed in "[<folder_name>]", in other words, the share name you entered in "/etc/samba/smb.conf".

About This Guide

In this text I teach how to create a network share via Samba via CLI (Command-line interface/Linux Terminal) on a uncomplicated, simple and brief way targeting Windows users.

Procedures

All commands must be done as root (command "sudo su").

  • Install Samba
    • apt-get update
      apt-get install samba

  • Set a password for your user in Samba
    • smbpasswd-a <user_name>

      • Note: Samba uses a separate set of passwords than the standard Linux system accounts (stored in /etc/samba/smbpasswd), so you'll need to create a Samba password for yourself. This tutorial implies that you will use your own user and it does not cover situations involving other users passwords, groups, etc...
        Tip: Use the password for your own user to facilitate.
  • Create a directory to be shared

    mkdir /home/<user_name>/<folder_name>

  • Make a safe backup copy of the original smb.conf file to your home folder, in case you make an error

    sudo cp/etc/samba/smb.conf ~

  • Edit the file "/etc/samba/smb.conf"

    nano /etc/samba/smb.conf

    • Once "smb.conf" has loaded, add this to the very end of the file:
      
      "
      [<folder_name>]
      path = /home/<user_name>/<folder_name>
      available = yes
      valid users = <user_name>
      read only = no
      browsable = yes
      public = yes
      writable = yes
      "
      Tip: There Should be in the spaces between the lines, and note que also there should be a single space both before and after each of the equal signs.
  • Restart the samba:

    restart smbd

  • Once Samba has restarted, use this command to check your smb.conf for any syntax errors

    testparm

  • To access your network share

    To access your network share use your username (<user_name>) and password through the path "smb://<HOST_IP_OR_NAME>/<folder_name>/" (Linux users) or "\\<HOST_IP_OR_NAME>\<folder_name>\" (Windows users). Note that "<folder_name>" value is passed in "[<folder_name>]", in other words, the share name you entered in "/etc/samba/smb.conf".

    • Note: The default user group of samba is "WORKGROUP".

Source

How to Create a Network Share Via Samba Via CLI (Command-line interface/Linux Terminal) - Uncomplicated, Simple and Brief Way! (last edited 2024-05-05 20:26:14 by ahasenack)