I. Setting up a SAMBA server
1. Download:
sudo apt-get install samba Samba-common
2. Create a shared folder MyShare:
Mkdir/home/user/myshare
chmod 777/home/user/myshare
3. backup config file (prevent error or loss):
sudo cp/etc/samba/smb.conf/etc/samba/smb.conf_backup
4. Enter the config file:
sudo gedit/etc/samba/smb.conf
5. Paste the following to the end (path is the file's paths):
[MyShare]
Comment = Public Stuff
Path =/home/user/myshare
Public = yes
writable = yes
printable = no
Write list = +staff
6. Find the [global] replacement in the file:
Workgroup = Workgroup
Display CharSet = UTF-8
Unix CharSet = UTF-8
DOS charset = cp936
7. Add Users
sudo useradd user name
8. Set the Samba password:
sudo smbpasswd-a username, enter password
9. View user Information
sudo vim/etc/samba/smbusers
Content: sambaxxx= "network username"
10. Restart the SMBD
sudo service smbd restart
Second, Mount (Mount) code to local
Mount the code locally:
1. Download the appropriate components for Samba:
sudo apt-get install cifs-utils
2. View the shared directory:
Smbclient-l 192.168.0.103-n
3. Mounting
(username= server's name, password = Server password, IP address = IP of its own server)
sudo mount-t cifs-o username= username, password= password//IP address/code/home/liyan/smb_code
Note:
1. Accessing the Samba address in the folder: smb://+ IP
2, through the terminal SSH access to the Samba server, can not access the words please download:
sudo apt-get install Openssh-server
Ubuntu Build Samba Server & Mount (mount) code to local