标签:
快速简单的创建共享,比网上那些乱七八糟过时的文档强太多
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 way targeting Windows users.
Procedures
All commands must be done as root (precede each command with ‘sudo‘ or use ‘sudo su‘).
Tip1: Use the password for your own user to facilitate.
Tip2: Remember that your user must have 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 screen by adjusting lightdm‘s configuration, in /etc/lightdm/users.conf add the newly created user to the line :
hidden-users=
mkdir /home/<user_name>/<folder_name>
sudo cp /etc/samba/smb.conf ~
sudo nano /etc/samba/smb.conf
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.
sudo service smbd restart
testparm
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".
Source
标签:
原文地址:http://www.cnblogs.com/baizx/p/4408711.html