Samba windows file sharing webmin

Webmin is an administration web UI for managing UNIX-like operating systems. For example, if you have an Ubuntu server and want an easier way to create Samba shares on your system, Webmin is an excellent tool.

With Webmin, you can create Samba shares on Ubuntu Server through your web browser, easily manage permissions, etc. In this guide, we’ll show you how to use Webmin to configure Samba shares in Ubuntu Server the easy way.

Set up Webmin on Ubuntu Server

Webmin must be installed on your Ubuntu system to use it. If you do not already have Webmin configured on Ubuntu, head over to the official website and download the latest DEB package.

After downloading the latest Webmin DEB package, install it onto your Ubuntu Server. The installation will not take long. When it is installed, open up a web browser on your computer and visit the following URL to access Webmin.

http://YOUR_UBUNTU_SERVER_IP_OR_HOSTNAME:10000

Root password for Webmin

You’ll need to know the root password for your Ubuntu Server. If you do not know your root password for Ubuntu Server, you’ll need to set it in the terminal before installing Webmin.

To configure the root password in Ubuntu Server, log in to the TTY console or SSH terminal using your username. When you’ve logged in, use the sudo -s command to escalate the console to root.

sudo -s

With root access, use the passwd command to change the password of the root account in Ubuntu.

passwd

Install Samba via terminal

You’ll have to install the Samba tools on your Ubuntu server installation before attempting to use Webmin to set up Samba shares. To install the latest Samba packages, open up a terminal and log into the Ubuntu server over SSH. Or sit down at the server physically and use the terminal.

Once you’ve logged into your Ubuntu server, the installation of Samba can begin. Using the apt install command below, install the “samba” package to your server.

sudo apt install samba

Upon writing in the command above, Ubuntu will ask for your password. Using the keyboard, write in your username’s password. Then, press the Enter key to submit your password.

After submitting your password in the terminal, Ubuntu will collect all packages and dependencies required to run the Samba server. Then, when everything is ready to install, Ubuntu will ask you to press the Y button on the keyboard. Do so to install Samba on your Ubuntu server.

Adding shares in Webmin

To add Samba shares to Ubuntu in Webmin, follow the step-by-step instructions down below.

Step 1: Log into the Webmin web UI in your favorite web browser using the root account and root password.

Step 2: After logging in to the Webmin web UI using your account credentials, click on the “Dashboard” button. Selecting the “Dashboard” button will show you the Webmin sidebar.

Look through the Webmin sidebar for the “Servers” section, and click on the drop-down menu to reveal the “Servers” options.

Step 3: Click on the “Samba Windows File Sharing” button to access the Samba section of Webmin. Once inside of the “Samba Windows File Sharing” area, click on the “Create a new file share” button.

Step 4: After clicking on the “Create a new file share” button, find the “Share name” section, and select it with the mouse. Then, type in the name of your new share. For example, “My Share,” “File Share,” etc.

Step 5: Find the “Directory to share” area, and click on it with the mouse. Then, type out the directory path you wish to share. Alternatively, click on the icon next to the text box.

By selecting the icon next to the text box, a pop-up window will appear. Using the pop-up window, select the folder you wish to share over the Samba file-sharing protocol.

Step 6: Click on the “Share Comment” text box, and type in a comment for your new file share. Then, select the “Create” button to create the next share.

Step 7: Once you’ve created your new share, click on the button to return to the shares list. Then, click on your share in the list to access the settings for it.

After accessing your share’s settings area, click on the “Security and Access Control” button. From here, you can customize your share’s access settings. For best results, select “Yes,” for “Writable,” and “Guest only” to allow users to access the share without logging in.

With all settings configured, select the “Save” button. Then, click on the “Return to share list” button.

Step 8: Select the ” Restart Samba Servers ” button when you’ve created all of your shares inside of Webmin and are done configuring everything. Selecting this button will restart the service on Ubuntu and apply your new configuration changes.

default avatar image

Create Users, share drives and folders across the network

Having lots of lovely space on your new server is no good if nothing other than the server itself can see it! So, let’s share some drives and folders using Samba so they can be seen by other computers and devices on your network.

Installing Samba

If you’ve not been following this guide from the start and/or do not have Samba installed then you can install samba in one of two ways: via the gnome desktop or via the Command Line.

Using the gnome desktop: choose System -> Administration and then Synaptic Package Manager from the menus. Type samba in the Quick Search box and then place a check against samba in the list of results returned and click Mark For Installation. Choose any additional packages too if prompted. Next click the Apply button and then the Apply button once again for confirmation.
If you do not have the Synaptic Package Manager installed (it is not installed by default under Lucid or Karmic) then you can install it by issuing sudo apt-get install synaptic from a Terminal or Putty session.

Using the Command Line: another way of installing samba on your server is by typing the following two commands either directly onto your server or via Putty:

sudo apt-get update

sudo apt-get install samba

Creating users

Before we get stuck into how we go about creating users and sharing folders we need to have a firm understanding of the concepts behind Linux File Permissions. This is especially true for those of you who are coming from a Windows background: Understanding Linux File Permissions

Now we have an understanding of the concepts behind users and permissions I’ll explain how to share a folder across the network using Webmin and you can take it from there.

First let’s create a new user. So, in Webmin, click System -> Users and Groups and click on Create a new user. Give the new user a Username, enter a Real name if required and for the Password click Normal password and supply a password. Under Group Membership use a Primary Group -> Existing group called users. Leave all other options asis and click the Create button. This will create a user which belongs to the users group.

This new user we’ve just created is only known to our server currently so we’ll now convert it into a “networked user”. This means we’ll be able to use this username to connect to designated files and folders on our server from elsewhere on our network.

So, click Servers -> Samba Windows File Sharing and click on Convert Unix users to Samba users and click on Convert users. Once we’ve done this we should configure the password for this user. The password for accessing the server via Samba can be the same as the one used to access the server via Putty but we still need to complete this step regardless. So, on the Samba Windows File Sharing screen click Edit Samba users and passwords and then click on the user we’ve just created. Then check the New password option and enter the required password. Then click Save.

Now re-start Samba via the Samba Windows File Sharing screen by clicking on the Restart Samba Servers button. We should now be able to access those files and folders on our server for which we’ve given permission to this new user.

Creating folders

Now let’s create a folder. We’ll create one in our home folder just for illustrative purposes. So, from a Putty/Terminal session type the following:

cd /home/YourUserName

where YourUserName is your Ubuntu username. This will switch us into your home folder.

Now type:

mkdir testfolder

to create a folder called “testfolder” within your home folder.

Now, let’s share this folder. So back to Webmin and go to Servers -> Samba Windows File Sharing click on Create a new file share and give the Share a name. Click on the Directory to share button and navigate to /home/YourUserName/testfolder. Click OK, change the Create with owner to the user we’ve just created by clicking on the button next to the field and choosing the new user.

Change the Create with group to be “users” and click the Create button. Now click on the Share Name you just created and then click on the Security and Access Control icon. Select Writable? Yes, and under Valid users click the button and select the user you just created. Then click the Save button.
This new user has read and write access to this “networked folder”. Obviously for read-only access you’d select “Writable? No”

Making symlinks visible across different shares

There are security issues caused by creating symlinks which point to different shares and so this feature is disabled by default. If you wish to have symlinks that point to files/folders outside the share they are created on then add the following 3 lines to the global section, [global], of the samba config file. So type:

sudo vim /etc/samba/smb.conf

to open the config file for editing. Then press the [Insert] key once to switch into Insert Mode and type or paste the following 3 lines into the file:

follow symlinks = yes
wide links = yes
unix extensions = no

Then press the [Esc] key once and type :wq to save and quit out of the file. If you make a mistake editing the file then issue :q! instead of :wq to abort your changes.

Changing the Windows Workgroup for our Ubuntu server

To make life simpler it’s probably a good idea to ensure that our server is in the same workgroup as the rest of the devices on our network. This is typically MSHOME. You can do this in Webmin by going into Servers -> Samba Windows File Sharing and clicking on the Windows Networking icon. Change the Workgroup from WORKGROUP to the name of your own workgroup. eg MSHOME, change the WINS mode to Be WINS server and click the Save button.

Lastly under Servers -> Samba Windows File Sharing click the Restart Samba Servers button at the bottom of the screen.

You can test the new share is working properly by going into Windows Explorer on your windows desktop computer and clicking on My Network Places -> Entire Network and selecting the workgroup (eg. MSHOME). Your server should be listed in there and you should be able to access “testfolder” created above.

If your new server doesn’t appear, try pressing the F5 button a few times and/or restarting the server. On mine I had to shut everything down (all computers, servers, everything) and restart my router for the changes to take effect.

Today we are going to see how to set up a Samba server on a VPS through Webmin.

Need to share files between your Windows and Linux systems? Activating Samba on your VPS with Webmin can make it easy. In this step-by-step guide, we’ll show you how to activate Samba on your VPS with Webmin and start sharing files between systems.

A server that implements the Samba protocol allows us to exchange files between Windows and Linux, with both being either servers or clients. In this case, we will focus on setting up the server within our VPS and connecting through Finder on Mac OS.

The first thing we need to do is access our server through Webmin and use the search feature to find Samba Windows File Sharing

We can access its configuration and install the service, and Webmin will take care of the rest. When the process is complete, we should have something like this.

samba windows file sharing

Now that we have Samba installed on our server, we just need to configure it.

The first thing we need to do is establish which elements we want to share with the clients. Samba allows us to define different access domains and assign them to certain users or groups depending on our needs. In this case, we will give privileged user “Sam” access to the entire file system.

Samba users

To give access, it is necessary to create the user by entering the following commands in the VPS terminal:


useradd Sam

And assign a password with:


passwd <tu_contraseÑa>
</tu_contraseÑa>

The next step is to add this user to the Samba users, including our Unix user in the smbpasswd file. To do this, type the following instruction that will ask us for the password for our Samba user:


smbpasswd -a Sam

Now our user Sam is authorized to use Samba on our server. The next step is to create the domain where the user Sam will be authorized to do what we allow. Click on “Create new file share”.

Shared directories

share directory samba webmin

And we will open the configuration window of the shared file where we establish the root directory of our disk as the directory to share and the owner user of said shared directory. In this case, it is our user Sam.

share information samba webmin

Once created, we will have our shared directory in Samba. With this configuration, it is completely accessible. If we want to adjust certain security and permission parameters in the files, we should navigate within the configuration of our shared directory and set the parameters.

Finally, we just have to test the connection to our server. To do this, we open Finder in Mac OS X (or any program that allows connections with the Samba protocol) and enter the following address:


smb://el_nombre_de_tu_servidor

The server will ask us for a user and password, and we use Sam and the password we assigned in the smbpasswd file. We connect and enter the root directory of our server using the Samba protocol.

As you can see, it is extremely simple and allows us to access our server from anywhere in a completely secure way. I

if you want to comment on anything, do not hesitate to contact me through the contact form.

Samba Configuration with Webmin: A Practical Overview

Setting up Samba with Webmin can seem intimidating at first. But don’t worry, I’ve got you covered. In this guide, we’ll walk through configuring Samba using Webmin. It’s actually pretty straightforward once you get the hang of it. So let’s dive right in.

First off, you might be wondering, what is Samba? Basically, it’s a free software that allows file and print sharing between computers running Windows and Unix. It’s kind of like a bridge that connects different operating systems. And Webmin? It’s a web-based interface for system administration on Unix. Together, they make managing your network shares a breeze.

So, what will you learn here? By the end of this guide, you’ll know how to install and configure Samba using Webmin. You’ll understand the basics of setting up shares, managing users, and securing your network. Plus, I’ll throw in some tips and tricks I’ve picked up along the way. Anyway, let’s get started.

Getting Started with Samba and Webmin

Alright, before we get into the nitty-gritty, let’s make sure you have everything you need.

What You’ll Need

  • A Linux server with root access
  • Webmin installed on your server
  • Basic understanding of Linux commands

If you don’t have Webmin installed yet, don’t sweat it. You can follow the instructions on TechRepublic to get it set up. It’s pretty much a straightforward process.

Installing Samba

First things first, you need to install Samba on your server. You can do this using the command line. Open up your terminal and type:


sudo apt-get update
sudo apt-get install samba

This will install Samba and all its dependencies. Easy enough, right?

Accessing Webmin

Once Samba is installed, you can access Webmin through your web browser. Just type in your server’s IP address followed by «:10000». For example:


https://your-server-ip:10000

Log in with your root credentials, and you’re good to go.

Configuring Samba with Webmin

Now that you have Samba installed and Webmin up and running, it’s time to configure Samba. This is where the fun begins.

Creating a basic share in Samba is actually pretty simple. Here’s how you do it:

  1. Log in to Webmin and go to the “Servers” section.
  2. Click on “Samba Windows File Sharing”.
  3. Click on “Create a new file share”.

You’ll see a bunch of options here. Don’t get overwhelmed; we’ll go through them step by step.

  • Directory to share: This is the path to the directory you want to share. For example, “/srv/samba/share”.
  • Share name: This is the name that will appear in the network. Keep it simple and descriptive.
  • Available: Make sure this is set to “Yes” so the share is accessible.
  • Writable: Set this to “Yes” if you want users to be able to write to the share.

There are a bunch of other options, but these are the basics. You can always come back and tweak the settings later.

Managing Samba Users

Next up, you need to manage your Samba users. This is important for security and access control. Here’s how you do it:

  1. In Webmin, go to the “System” section.
  2. Click on “Users and Groups”.
  3. Click on “Create a new user”.

Fill in the details for the new user. Make sure to set a strong password. Once the user is created, you need to add them to the Samba password database. You can do this by running:


sudo smbpasswd -a username

Replace “username” with the actual username you created. This command will prompt you to set a Samba password for the user.

Security is super important, especially when you’re sharing files over a network. There are a few things you can do to secure your Samba share:

  • Use strong passwords: This one’s a no-brainer. Make sure all your users have strong, unique passwords.
  • Limit access: You can restrict access to your share by IP address. In Webmin, go to the Samba configuration and set the “Hosts allow” option to specific IP addresses or ranges.
  • Enable encryption: Samba supports encryption, which can add an extra layer of security. You can enable this in the Samba configuration under the “Security options” section.

These steps should help keep your shares secure. But remember, security is an ongoing process. Always stay up-to-date with the latest best practices.

Advanced Samba Configuration

Alright, so you’ve got the basics down. But what if you want to do more with Samba? Let’s dive into some advanced configuration options.

Sharing a printer over Samba is actually pretty straightforward. Here’s how you do it:

  1. In Webmin, go to the “Servers” section.
  2. Click on “Samba Windows File Sharing”.
  3. Click on “Create a new printer share”.

You’ll need to fill in some details about your printer. The most important ones are:

  • Printer name: This is the name that will appear in the network.
  • Printer driver: You can upload a driver file if needed.
  • Printable: Make sure this is set to “Yes” so the printer is accessible.

Once you’ve set up the printer share, users on your network should be able to add the printer just like they would any other network printer.

Configuring Samba as a Domain Controller

If you want to take things to the next level, you can configure Samba as a domain controller. This is a bit more complex, but it’s totally doable. Here’s a basic overview of the steps:

  1. Install the necessary packages:

sudo apt-get install samba winbind libnss-winbind libpam-winbind
  1. Configure the Samba domain controller:

sudo samba-tool domain provision
  1. Join machines to the domain:

sudo realm join --user=administrator your-domain.local

This is just a high-level overview. There are a lot of details to consider when setting up a domain controller. You might want to check out some more in-depth guides if you’re serious about this.

Troubleshooting Samba Issues

Even with the best planning, things can go wrong. Here are some common Samba issues and how to troubleshoot them:

  • Users can’t access the share: Make sure the share is set to “Available” and “Writable” if needed. Check the user permissions and ensure the Samba password is set.
  • Slow performance: This could be due to network issues or high load on the server. Check your network speed and server resources.
  • Authentication problems: Make sure the Samba password database is up-to-date. You can sync it with the command sudo pdbedit -L.

If you run into issues, don’t panic. Take a deep breath and go through the troubleshooting steps. Chances are, it’s something simple that you can fix quickly.

Best Practices for Samba Configuration

Before we wrap up, let’s go over some best practices for configuring Samba. These tips will help you keep your shares running smoothly and securely.

  • Keep Samba updated: Make sure you’re running the latest version of Samba. Updates often include security patches and new features.
  • Regularly back up your data: This one’s important. Always have a backup of your shared data. You never know when something might go wrong.
  • Monitor your shares: Keep an eye on your shares to make sure they’re running smoothly. You can use tools like SitePoint to monitor your server.

Following these best practices will help you get the most out of Samba. And remember, always stay up-to-date with the latest tips and tricks.

Wrap-Up: Samba Configuration Made Easy

And there you have it! Configuring Samba with Webmin doesn’t have to be complicated. With a bit of practice, you’ll be setting up shares like a pro. Remember, the key is to take it one step at a time and not get overwhelmed.

So go ahead, give it a try. You might be surprised at how easy it is once you get started. And if you run into any issues, don’t hesitate to reach out for help. There are plenty of resources available, and someone’s always willing to lend a hand.

FAQ

How do I install Samba on my Linux server?
You can install Samba using the command line. Open your terminal and type: sudo apt-get update and sudo apt-get install samba.
Can I share printers with Samba?
Yes, you can share printers with Samba. In Webmin, go to the “Servers” section, click on “Samba Windows File Sharing”, and then click on “Create a new printer share”.
How do I secure my Samba shares?
You can secure your Samba shares by using strong passwords, limiting access by IP address, and enabling encryption. In Webmin, go to the Samba configuration and set the “Hosts allow” option to specific IP addresses or ranges. You can also enable encryption under the “Security options” section.
What should I do if users can’t access the share?
If users can’t access the share, make sure the share is set to “Available” and “Writable” if needed. Check the user permissions and ensure the Samba password is set. You can sync the Samba password database with the command sudo pdbedit -L.

References

TechRepublic, SitePoint

Warning

Перед началом работы с данной инструкцией, убедитесь, что в системе создана и надлежащим образом сконфигурирована файловая система ZFS, для которой будет предоставляться доступ по SMB протоколу.

Используйте таблицу ниже, для создания (см. соответствующую инструкцию) и контроля параметров датасета.

Параметр Значения

Только для чтения

off

Имя пользователя и группа

nobody:nobody

Права доступа

755

Откройте браузер и введи в строке адреса URL: https://IP_ADDRESS:10000, где IP_ADDRESS это реальный адрес вашего сервера Webmin:

Введите имя пользователя и пароль в соответствующих полях формы логина. 

Вы будете перенаправлены в главное окно системы Webmin. В центральном (главном) фрейме окна отображается текущее состояние системы, где установлен Webmin; в левом фрейме отображается список модулей, доступ к которым разрешен для текущего пользователя.

Для перехода к модулю управления ресурсами SMB, раскройте спойлер Службы в левом фрейме окна и кликните на ссылку Samba Windows File Sharing

Начальный экран модуля содержит список ресурсов SMB, сконфигурированных на данном сервере. Кликнув на ссылку с именем определенного ресурса, можно ознакомиться с деталями его конфигурации.

Для добавления нового файлового ресурса SMB, кликните ссылку Создание нового файлового ресурса, расположенную под списком всех ресурсов SMB

Заполните поля параметров в открывшейся форме.

Внимание

Обратите внимание, что поле Каталог ресурса должно указывать на существующий датасет в заданном пуле хранения данных. Ввод в данное поле других значений, таких как несуществующий путь к датасету или неверный пул хранения данных, приведет к ошибке при создании файлового ресурса SMB

По окончании ввода данных, кликните кнопку Создать, расположенную внизу формы.

Убедитесь, что файловый ресурс создан успешно и присутствует в общем списке файловых ресурсов SMB, сконфигурированных на данном сервере. 

Обратите внимание, созданный ресурс находится по умолчанию в режиме Только чтение для всех известных пользователей. Запись данных на этот ресурс невозможна без выполнения дополнительной конфигурации.

Для того, чтобы разрешить запись на созданный ресурс SMB, кликните на ссылку с его именем в общем списке ресурсов

Вы будете перенаправлены в форму Редактирование файлового ресурса

 

Кликните иконку Управление безопасностью и доступом в разделе Другие параметры ресурса

Отредактируйте параметры безопасности данного ресурса, следуя описанию из таблицы ниже:

Параметр Значение

Разрешена запись

Да

Гостевой доступ

Только гость

Гостевой пользователь UNIX

nobody

Внимание

  • В настоящее время, поддерживается только публичный доступ к файловым ресурсам SMB, аутентификации и авторизации пользователей не происходит. Это означает, что любой пользователь, имеющий сетевой доступ к данному серверу, также получает доступ ко всем файловым ресурсам SMB, расположенным на нем.
  • Для того, чтобы сделать доступ к ресурсам SMB более безопасным, используйте поле Разрешенные узлы, где можно указать IP адреса или сети, с которых разрешено получать доступ к конкретным ресурсам SMB.

По окончании ввода данных, кликните кнопку Сохранить для применения сделанных изменений.

Кликните ссылку Вернуться к списку ресурсов внизу окна редактирования файлового ресурса.

Убедитесь, что поле безопасность изменилось на Чтение/Запись для всех, что означает возможность записи данных на этот ресурс.

Далее необходимо проверить и, в случае необходимости, запустить Samba services на данной системе. Для этого проверьте, присутствует ли кнопка Запуск серверов Samba в самом низу окна модуля. Если кнопка присутствует, значит сервисы не запущены.

 

Кликните кнопку Запуск серверов Samba. В случае успешного запуска сервисов, экран модуля примет следующий вид:

Для проверки доступа к созданному ресурсу SMB, на рабочей станции с установленной ОС MS Windows откройте программу Проводник и наберите в строке адреса следующий URL: \\SERVER_NAME_OR_IP\smb1

Указанный ресурс должен быть доступен, что говорит о его правильной конфигурации.

Для проверки возможности записи на данные ресурс, скопируйте туда любой файл или создайте пустой каталог. Если операция пройдет успешно, то запись на этот ресурс разрешена

Вы всегда можете поменять параметры любого ресурса SMB, используя эти инструкции.

Для удаления существующего файлового ресурса SMB, откройте общий список ресурсов сервера и отметьте тот ресурс, который необходимо удалить

Кликните кнопку Удалить выбранные шары под списком ресурсов.

Внимание

  • Будьте внимательны при выполнении данной операции. Убедитесь, что Вы удаляете именно тот ресурс, который необходимо.
  • Ресурс будет удален немедленно, никаких дополнительных подтверждений для операции удаления запрошено не будет.
  • Удаление файлового ресурса SMB не влияет на данные, расположенные на датасете, для которого был создан данный ресурс и означает прекращение возможности доступа к этим данным по протоколу SMB. Для того, чтобы удалить именно данные на датасете, используйте возможности модуля zfsmgr.

Убедитесь, что ресурс удален успешно, и его имя больше не отображается в списке файловых ресурсов

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Xerox phaser 3122 драйвер windows 10 x64 как установить
  • Windows 7 сборка 7601 ваша копия windows не является подлинной что это
  • Максимальный размер жесткого диска для windows xp
  • Windows xp logon screensaver
  • Mysql workbench download windows 10