3. Using Ubuntu server to set up a standalone hard disk-based Windows file sharing and FTP server (Samba sharing)

Source: Internet
Author: User

It's not hard to create a samba file share, but the point is to create a Linux account (to match the samba account) and set up shared folder permissions. In particular, the Permissions section, compared to not so intuitive windows, understanding of the future is not difficult, but here is not intended to be complex in-depth explanation.


My setup purpose is basically a requirement, so that all members of the FTP group can have read and write permissions in the storage shared folder, and want all new folders created under Storage to inherit storage permission settings.


Group: FTP

Members: Xin, gong


The user created at the time of system installation is Xin,gong user and the FTP group has not been created, so we will add the member and the group first.

sudo useradd gongsudo passwd gong above instruction can create user gong and set password, then we create FTP group sudo groupadd ftp then user xin, Gong join to the FTP group (under Linux is the second group secondary groups, do not change the user default group) sudo usermod-a-G ftp Xinsudo usermod-a-G ftp gong through the ID xin this directive can see if Tim Add group success.

With the user, with the group, now to/storage this folder to set the appropriate permissions, and set the appropriate user for Samba

Go to the root directory to execute ls-l, you can see: drwxr-xr-x 3 root root 4096 Sep 4 12:20 storage This means storage This folder is currently all human root, all groups are Roo T. Everyone I don't need to change, I need to switch the group to FTP and have all FTP groups have read and write rights.    sudo chown:ftp/storagesudo chmod 775/storage (if you don't want to see other accounts, you can do it with 770 permissions) ls-l View results: Drwxrwxr-x 3 root FTP 4096 SEP 4 12:20 Storage Add Samba users: sudo smbpasswd-a xinsudo smbpasswd-a gong

When executing the instructions above, each user added will automatically be asked to set the samba password for that user. This password can be different from signing in to the Ubuntu system, which is the account and password required for Windows to access the shared folder. For convenience, you can usually set up a samba user and password that matches your Windows account so that Windows does not need to enter a password when it opens a shared folder.


In addition, Samba added users must be present, that is, you have to use Useradd to add a corresponding Linux login account, otherwise it will go wrong.


To this step, actually still almost. As I said before, to let the new folders created under the Storage shared folder integrate the permissions of the parent folder, otherwise the file created by Xin will be gong inaccessible (of course you will need this effect). To do this, you need to execute another line of instructions:

sudo chmod g+s/storage

This step completes the configuration of the permissions. Finally, follow the instructions below to change the contents of/etc/samba/smb.conf:

sudo cp/etc/samba/smb.conf/etc/samba/smb.conf.bak (Backup configuration file first) sudo nano/etc/samba/ Smb.conf with the editor open smb.conf, the default settings do not change anything, skip to the end, create the following: [storage]comment = Ubuntu File Server (description of the shared folder) path =/storage ( Shared folder path) Available = yes (available) Valid users = @ftp (@ftp refers to the FTP group, if the user does not need @, multiple users are separated by a space) Read Only = no (whether read only) browsable = Yes (if visible, no if open shared path is not seen folder, but can be accessed directly through the path) writable = yes (writable) save after exiting, restart service: sudo restart SMBD

Now go to Windows--run->\\192.168.1.xx (Ubuntu IP address)

Should be able to see the storage folder, enter after the attempt to create a new file, if everything is OK, then the share is complete.


This article is from the "www.DIYPCs.com" blog, make sure to keep this source http://cnbeta.blog.51cto.com/1234897/1548971

3. Using Ubuntu server to set up a standalone hard disk-based Windows file sharing and FTP server (Samba sharing)

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.