Ubuntu Build Samba Server & Mount (mount) code to local

Source: Internet
Author: User
Tags ssh access

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

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.