How to create a share using samba under Ubuntu

Source: Internet
Author: User

create shares quickly and easily , It's a lot better than those messy, outdated documents on the Web.

Original Address :https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share% 20via%20samba%20via%20cli%20%28command-line%20interface/linux%20terminal%29%20-%20uncomplicated,%20simple% 20and%20brief%20way!

How to Create a Network Share via Samba via CLI (command-line interface/Linux Terminal)-Uncomplicated, Simple and Brief way!

In this text, I teach how to create a network share via Samba using the CLI (command-line interface/linux Terminal) in an Uncomplicated, simple and brief targeting Windows users.

Procedures

All commands must is done as root (precede command with ' sudo ' or use ' sudo su ').

  1. Install Samba
    1. sudo apt-get update
    2. sudo apt-get install Samba
  2. Set a password for your user in Samba
    1. sudo smbpasswd-a <user_name>
      1. 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 so you'll use your own user and it does don't cover situations involving other users passwords, GR Oups, etc ...

        Tip1:use the password for your own user to facilitate.

        Tip2:remember that your user must has permission to write and edit the folder you want to share.

        Eg.:

        sudo chown <user_name>/var/opt/blah/blahblah

        sudo chown:<user_name>/var/opt/blah/blahblah

        Tip3:if you ' re using another user than your own, it needs to exist in your system beforehand, you can create it without a Shell access using the following command:

        sudo useradd USERNAME--shell/bin/false

        ?

        You can also hide the user on the login screens by adjusting LIGHTDM ' s configuration, in/etc/lightdm/users.conf add the NE Wly created user to the line:

        hidden-users=

  3. Create a directory to be shared

    Mkdir/home/<user_name>/<folder_name>

  4. Make a safe backup copy of the original smb.conf file to your home folder,

    sudo cp/etc/samba/smb.conf ~

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

    sudo nano/etc/samba/smb.conf

    1. Once "smb.conf" have loaded, add this to the very end of the file:
    2. ?
    3. [<folder_name>]
    4. Path =/home/<user_name>/<folder_name>
    5. Available = yes
    6. Valid users = <user_name>
    7. Read Only = no
    8. browseable = yes
    9. Public = yes
    10. writable = yes

      Tip:there should is in the spaces between the lines, and note que also there should is a single space both before and aft Er each of the equal signs.

  6. Restart the Samba:

    sudo service smbd restart

  7. once Samba have restarted, use this command to check your smb.conf for any syntax errors

    testparm

  8. To access your network share

    To access your network share use your username (<user_name>) and password through the path "Smb://

    1. Note:the Default User group of samba is "WORKGROUP".

Source

    1. Http://www.hardcode.nl/archives_147/article_548-samba-quick-setup-on-ubuntu-1004.htm

How to create a share using samba under Ubuntu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.