How to Use System-Config-Samba on Ubuntu 17.10

Source: Internet
Author: User

How to Use System-Config-Samba on Ubuntu 17.10

System-config-samba is a graphical interface used to manage samba sharing and users. In my previous tutorial, I explained how to set up the Samba server on Ubuntu 16.04 on the command line, but the Samba configuration file may confuse beginners. This tutorial will show you how to use the graphical tool (system-config-samba) to set up the Samba server. (Ubuntu 16.04 and Ubuntu 17.10 can be set according to this tutorial)

 

Install the Samba server on Ubuntu 17.10

Before using system-config-samba, run the following command on the terminal to install the Samba server suite from the Ubuntu repository.

Bkjia @ bkjia :~ $ Sudo apt install samba-common-bin

For example:

The latest stable version is 4.7.4, which was released on July 4, December 22, 2017. To check your Samba version, run

Bkjia @ bkjia :~ $ Smbd -- version

Output example:

Samba version 4.6.7-Ubuntu

To check whether the Samba service is running, run the following command.

Bkjia @ bkjia :~ $ Systemctl status smbd

Output example:
● Smbd. service-Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd. service; enabled; vendor preset: ena
Active: active (running) since Mon 2011-1-22 13:24:45 CST; 1 min 5S ago
Docs: man: smbd (8)
Man: samba (7)
Man: smb. conf (5)
Main PID: 5610 (smbd)
Status: "smbd: ready to serve connections ..."
Tasks: 4 (limit: 4915)
CGroup:/system. slice/smbd. service
2017-5610/usr/sbin/smbd
2017-5611/usr/sbin/smbd
Lines 1-12... skipping...
● Smbd. service-Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd. service; enabled; vendor preset: ena
Active: active (running) since Mon 2011-1-22 13:24:45 CST; 1 min 5S ago
Docs: man: smbd (8)
Man: samba (7)
Man: smb. conf (5)
Main PID: 5610 (smbd)
Status: "smbd: ready to serve connections ..."
Tasks: 4 (limit: 4915)
CGroup:/system. slice/smbd. service
2017-5610/usr/sbin/smbd
2017-5611/usr/sbin/smbd
2017-5612/usr/sbin/smbd
Lines 1-13... skipping...

... Omitted ......

● Smbd. service-Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd. service; enabled; vendor preset: ena
Active: active (running) since Mon 2011-1-22 13:24:45 CST; 1 min 5S ago
Docs: man: smbd (8)
Man: samba (7)
Man: smb. conf (5)
Main PID: 5610 (smbd)
Status: "smbd: ready to serve connections ..."
Tasks: 4 (limit: 4915)
CGroup:/system. slice/smbd. service
2017-5610/usr/sbin/smbd
2017-5611/usr/sbin/smbd
2017-5612/usr/sbin/smbd
2017-5616/usr/sbin/smbd

January 22 13:24:44 bkjia systemd [1]: Starting Samba SMB Daemon...
January 22 13:24:44 bkjia systemd [1]: smbd. service: Supervising process 5610 whic
January 22 13:24:45 bkjia systemd [1]: Started Samba SMB Daemon.

Run again:

Bkjia @ bkjia :~ $ Sudo systemctl start nmbd

Once started, smbd listens on TCP ports 139 and 445. Nmbd listens on UDP ports 137 and 138.

  • TCP 139: used for file and printer sharing.
  • TCP 445: No CIFS port for NetBIOS.
  • UDP 137: used for NetBIOS network browsing.
  • UDP 138: used for NetBIOS Name Service.
Install system-config-samba

Run the following command to install it.

Sudo apt install system-config-samba

Then we can start it from the command line.

Sudo system-config-samba

If you get the following error:

Cocould not open configuration file '/etc/libuser. conf': the file or directory does not exist.

You can use the following command to create an empty/etc/libuser. conf file to fix it.

Sudo touch/etc/libuser. conf

If the following errors exist:

For example:

(System-config-samba: 6424): Gtk-WARNING **: The topic engine "pixmap" cannot be found in the module path ",

Solution:

Sudo apt-get install gtk2-engines
Sudo apt-get install gtk2-engines -*

This error is also reported.

(System-config-samba: 7536): Gtk-WARNING **: The topic engine "adwaita" cannot be found in the module path ",

Solution:

Sudo apt-get install gnome-themes-standard

Also:

(System-config-samba: 7658): IBUS-WARNING **: The owner of/home/bkjia/. config/ibus/bus is not root!

For the solution, see

Then run the startup command again. This is the default Interface.

 

Create a Samba share

First, create a Samba user. Now we can open a new terminal window (because the current terminal window is being used by system-config-samba) and use the following command to create a Linux User. Replace linuxmi with your preferred user name.

Sudo adduser linuxmi

Enter your sudo password. Set a password for the new user. You can press Enter to answer the remaining questions.

Next, we need to set a separate Samba password for the user.

Sudo smbpasswd-a linuxmi

Now, in the Samba graphical interface, click preferences> server settings menu. Make sure that the workgroup value is the same as that set for Windows computers (for example ).

Click the plus sign to create a Samba share. On the Basic tab, specify

  • Directory/folder to be shared (take/home/bkjia/Desktop as an example)
  • Share Name (for example, Linuxidc)
  • Shared description (for example, Linuxidc)
  • Can remote users write data to Samba for sharing?
  • Can other computers in the network see Samba sharing (usually)

Ubuntu 17.10 Samba private sharing

On the "access" tab, select the Samba user you just created and click "OK ". If the Samba user is not displayed, restart system-config-samba. If you select "allow access to all", others in the same network can access the shared folder without entering the user name and password.

Samba private share with security = user

To allow users to write to shared folders, run the following command to grant read, write, and execute permissions.

Sudo setfacl-R-m u: username: rwx/path/to/the/share/

For me, I need to run

Sudo setfacl-R-m u: linuxmi: rwx/home/bkjia/Desktop/

If you choose to allow access to all users, You need to grant the read, write, and execute permissions to the nobody user so that others can change the file/folder.

Sudo setfacl-R-m u: nobody: rwx/path/to/the/share/

Now, you have to restart the Samba server. (Remember to restart Samba)

Sudo systemctl restart smbd nmbd

Access the Samba shared folder from Windows (Windows XP, Windows 7, Windows 10)

On a Windows computer in the same network, open file resource manager and click Network in the left pane. Double-click the Host Name of your Ubuntu computer. For example, the host name of my Ubuntu 17.10 computer is LINUXIDC.

Double-click the shared folder and enter the Samba user name and password.

Go to the shared folder and see:

Test File writing:

OK! We hope this tutorial will help you use system-config-samba on Ubuntu 17.10. As usual, if you find this article useful, please tell more Linux fans about the help House website www.bkjia.com.

 

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.