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 ').
- Install Samba
- sudo apt-get update
- sudo apt-get install Samba
- Set a password for your user in Samba
- sudo 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 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=
- 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,
sudo cp/etc/samba/smb.conf ~
- Edit the file "/etc/samba/smb.conf"
sudo nano/etc/samba/smb.conf
- Once "smb.conf" have 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
- browseable = yes
- Public = yes
- 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.
- Restart the Samba:
sudo service smbd restart
- once Samba have 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://
- Note:the Default User group of samba is "WORKGROUP".
Source
- Http://www.hardcode.nl/archives_147/article_548-samba-quick-setup-on-ubuntu-1004.htm
How to create a share using samba under Ubuntu