Как расшарить папку linux mint для windows

Linux Mint has always been known for its simple interface and ease of use. One of its many benefits is its ability to share files and folders across a network, which can be helpful for businesses or individuals who need to collaborate on projects or transfer data between computers. These files can be shared through various methods, including Samba, NFS, and FTP. This article will focus on Samba, a popular and widely used file-sharing tool on Linux systems.

Let us walk you through setting up and configuring file sharing. All essential steps for enabling file-sharing options, configuring network settings, and setting up user permissions and access controls will be covered. There are also tips for going around common issues during this process. By the end, you will have a comprehensive understanding of sharing files and folders on a Linux Mint network using Samba and will be equipped with the knowledge and skills to share data seamlessly. Sharing files between Linux and other operating systems is another point of concern for many users. Are you looking to do so? Go through this comprehensive guide on how to share files between Android and Linux wirelessly.

Sharing files and folders on a Linux Mint network

Sharing files on a Mint network can benefit individuals and businesses alike. Sharing files and folders allows you to collaborate more efficiently, streamline workflows, and access data from multiple computers or devices. For businesses, file sharing on a Linux Mint network can be particularly useful for project teams. This allows team members to collaborate in real-time, make changes to documents or files, and access the most up-to-date versions of files without transferring data between devices or sending them via email manually.

Sharing files on a Linux Mint network

Individuals can also benefit from these valuable features. For example, you may want to share music, videos, or documents if you have multiple computers at home. With this quick setup, you can easily access all files from any of your devices without copying them separately. Moreover, sharing files on a Mint network is much more secure than sending them through email or transferring them via USB drives. By setting up user permissions and access controls, you can ensure that only authorized users can access shared material, reducing the risk of breaches or unauthorized access.

Setting up file sharing

Setting up file sharing on a Linux Mint network involves a few basic steps. These include enabling file-sharing options and configuring network settings. This section will walk you through these processes in a step-by-step guide. Installing software on Linux Mint can be a challenge for new users. However, Snap packages offer an easier way to install and update applications. Learn all about them in this detailed article.

Enabling file-sharing options

Step 1: The first step to set up file sharing on a Linux Mint network is to enable file-sharing options. Open the Cinnamon menu by clicking on the Linux Mint logo in the bottom left corner of your screen.

Opening the Cinnamon menu

Step 2: Navigate to “Preferences” in the “System settings.”

Preferences section in system settings

Preferences section in system settings

Step 3: Go to “Sharing options,” and in the Sharing window, toggle the “Share this folder” button to the “On” position.

Toggling the share this folder button

Toggling the share this folder button

Configuring network settings

Step 1: Once you have enabled file-sharing options, you must also configure the network settings. Open the Cinnamon menu by clicking on the Linux Mint logo in the bottom left corner of your screen.

Step 2: Navigate to “Network” in the “System settings.”

Opening the Network settings

Opening the Network settings

Step 3: Make sure that the connection you want to use for file sharing (e.g., Ethernet or Wi-Fi) has been set up in the network settings window.

Verifying the network connection

Verifying the network connection

Connecting shared folders

Step 1: After enabling file sharing and configuring the network settings, you can connect shared folders on the network. Open the file manager by clicking on your desktop’s folder icon or the Cinnamon menu.

Opening the file manager

Step 2: Click “Network” in the left-hand sidebar of the file manager.

Opening network from the file manager sidebar

Opening the network from the file manager sidebar

Step 3: Find the computer with the shared folder you want to access and double-click on it.

Finding a shared folder

Finding a shared folder

Step 4: Enter your username and password (if required) and click “Create Share.”

Creating share connection with the connected folder

Creating a shared connection with the connected folder

Sharing files and folders using Samba

Samba is a standard tool for file sharing on Linux systems, and it is also widely used for sharing files and folders on networks. This section will walk you through setting up and using Samba to share files and folders on a Linux Mint network.

Step 1: The first step is to install Samba on your system. To do this, open a terminal window and enter the following command. Doing so installs Samba on your device.

sudo apt-get install samba

Installing Samba on your system

Installing Samba on your system

Step 2: The next step is to create a shared folder you want to share with other users on the network. Create a new folder in your system’s home directory or anywhere else.

Creating a new folder to be shared

Creating a new folder to be shared

Step 3: Right-click on the folder and select “Sharing Options.” Toggle the “Share this folder” option to “On.” Next, set the “Guest access” option to “Allow access to everyone” and set the “File sharing” option to “SMB.”

Setting up sharing options for the folder

Setting up sharing options for the folder

Step 4: Once you have created a shared folder, you must configure Samba to allow other users on your network to access it. Open the Samba configuration file by typing the following command in a terminal window.

sudo nano /etc/samba/smb.conf

Opening the Samba configuration file

Opening the Samba configuration file

Step 5: Scroll down to the end of the file and add the following lines:

Editing the Samba configuration file

Editing the Samba configuration file

Replace “Folder1” with the name of your shared folder and the path with the actual path to that folder.

Step 6: After configuring Samba, you must restart it for the changes to take effect. To restart, enter and run the following command in a terminal window.

sudo service smbd restart

Restarting Samba

Restarting Samba

Step 7: Open the file manager and navigate to “Network.” Find the computer that has the shared folder and double-click on it.

Opening the network with shared folder

Opening the network with a shared folder

Step 8: Enter your username and password (if required) and click “Connect.” You can now navigate to that folder and send its contents throughout the network.

Connecting with the shared folder across network

Connecting with the shared folder across the network

Configuring file permissions and access

When sharing files and folders on a Linux Mint network, it is essential to configure file permissions and access controls to ensure that only authorized users can access shared files. This section includes configuring these permissions and access controls on a Mint network.

Step 1: The first step is to set file permissions for the shared folder. Right-click on the shared folder and select “Properties.” Navigate to the “Permissions” tab.

Opening properties of the shared folder

Opening properties of the shared folder

Step 2: Set the “Owner” and “Group” permissions to your username and group, respectively. Set the “Others” permissions to “None.”

Setting the owner and group permissions

Setting the owner and group permissions

Step 3: The next step is to create user accounts for other users who need access to the shared folder. Open the Users and Groups window by clicking the Cinnamon menu and selecting “Users and Groups.”

Opening the users and group section

Opening the users and group section

Step 4: Create a new user by clicking the “+” button. Enter the user’s name and password, and click “Add.” Repeat this process for each user who needs access to the shared folder.

Adding a user to the network

Step 5: After creating user accounts, you must grant them access to the shared folder. Right-click on the shared folder and select “Sharing Options.” Navigate to the “Permissions” tab. Add a new user to share that folder with.

Allowing folder access to the created user

Allowing folder access to the created user

Step 6: Select the user you want to grant access to and set their access level to “Read” or “Write.” Repeat this process for each user who needs access to the shared folder.

Step 7: After configuring file permissions and access controls, you must restart Samba for the changes to take effect.

Conclusion

Sharing files and folders on a Linux Mint network is a powerful way to collaborate and exchange information among users. Linux Mint users can share files and folders on a local network by enabling file-sharing options, configuring network settings, and using tools like Samba. We have covered the basic steps for setting up file sharing and configuring permissions and access controls to ensure that only authorized users can get access.

File sharing on a Linux Mint network is a valuable capability for businesses, organizations, and individuals who need to collaborate and exchange information regularly. With the right tools and settings, it can be a simple and effective way to enhance productivity and communication within a network. OpenVPN is a free VPN service for secure remote access to your server/machine. Here is how you can set it up on Linux Mint.

Настроить локальную сеть между Linux и Windows через роутер по Wi-Fi оказалось не сложной задачей. Возможно, настройки по умолчанию были выстроены как надо. Честно сказать, я не специалист по настройке локальной сети и данная статья не содержит каких-то углублённых настроек и сложной конфигурации сети. Всё просто: обмен данных идёт через роутер, доверяем сети и позволяем Windows и Linux менять содержимое папки.

Покажу как я настраивал обмен данными по локальной сети через расшаренную папку. Для взаимодействия Linux с другими компьютерами нужно установить samba:

sudo apt-get install samba

Создаём папку с необходимым именем (напр., shared_folder) в своей домашней папке и открываем доступ (опубликовываем) через контекстное меню, другими словами нужно щёлкнуть правой кнопкой по папке и выбрать «Опубликовать…» (у кого-то пункт может называться «открыть доступ»).

Вводим пароль администратора и в появившемся окошке выставляем следующие параметры:

Затем заходим в свойства папки:

Везде выставляем максимальные права на изменение содержимого папки:

Щелкаем распространить права на вложенные файлы и нажимаем «Закрыть».

Теперь должно работать расшаривание в обе стороны: можно добавлять и изменять содержимое папки как в Linux, так и в Windows.

Чтобы из Windows открыть расшаренную папку нужно в проводнике найти пункт «Сеть». В этой папке должен быть виден другой компьютер Linux:

Виден компьютер VIVAZZI-MINT-PC и папочку shared_folder. В ней можно вставлять и доставать файлы.

Вот и всё. Если что-то пошло не так, то искать в гугле, потому как, ещё раз повторюсь, с локальными сетями я имею дело крайне редко.

П. С. Прошу прощения за качество некоторых изображений — в Linux Mint почему-то не могу сделать скриншот, когда открыто контекстное меню.

Оцените статью

После нажатия кнопки «Отправить» ваше сообщение будет доставлено мне на почту.

Артём Мальцев

Веб-разработчик, владеющий знаниями языка программирования Python, фреймворка Django, системы управления содержимым сайта Django CMS, платформы для создания интернет-магазина Django Shop и многих различных приложений, использующих эти технологии.

Права на использование материала, расположенного на этой странице https://vivazzi.pro/ru/it/common-folder-windows-linux/:

Разрешается копировать материал с указанием её автора и ссылки на оригинал без использования параметра rel="nofollow" в теге <a>. Использование:

Автор статьи: Артём Мальцев
Ссылка на статью: <a href="https://vivazzi.pro/ru/it/common-folder-windows-linux/">https://vivazzi.pro/ru/it/common-folder-windows-linux/</a>

Больше: Правила использования сайта

Представляю вашему вниманию книгу, написанную моим близким другом Максимом Макуриным: Секреты эффективного управления ассортиментом.

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

Let’s learn commands and steps – how to share files and folders using Samba by installing it on Linux Mint which is not there by default.  

Install and Configure Samba Server on Linux Mint 201. Run system update2. Install Samba on Linux Mint3. Allow samba in Linux Mint Firewall4. Add your user to the Samba group5. Share some Linux Mint folder6. Access the shared folder on Windows or LinuxExtra tip- Linux Mint SambaShare User

What is a Samba server?

Samba is a popular, open-source networking software that computers with a Unix or Linux – operating system allow the sharing of network resources from Windows -networks, such as files and printers. However, it is not limited to Windows only, we can install and use on Unix / Linux- based servers pr Desktop to share resources over the network.  The common protocols Server Message Block (SMB) and Common Internet File System (CIFS, an open version of SMB) are the basis on which Samba is based. The name ” Samba ” is just a name given to represent “SMB”.

If you are using Linux Mint and want to share some folder, then right-click on it and select properties. And then the Share Tab. However, you will not able to enable this option because samba is not there yet.  To confirm, you can see a message given at the bottom Samba needs to be installed, appropriate firewall rules need to be added and your user account needs to join the ‘samba share group.

To solve this let’s follow the given steps in this article…

How to enable SAMBA on Linux Mint

Install and Configure Samba Server on Linux Mint 20

1. Run system update

Well, it is not a necessary step, however, run the system update command to rebuild the repo cache and make sure all the system installed packages are up to date.

sudo apt update

2. Install Samba on Linux Mint

Next, in your command terminal use the APT package manager to install Samba on your Linux Mint. The packages to set it up are already there in the system repository, thus we don’t need to add anything extra.

sudo apt install samba

Check its service is active and running:

sudo systemctl status smbd

install and check samba service is running on Linux Mint

If it is not active then run:

sudo systemctl --enable now smbd

3. Allow samba in Linux Mint Firewall

To connect and access the shared files over SMB protocol, we have to first whitelist and allow its service to get accessed from the outside of the computer. Thus, allow it in the firewall

sudo ufw allow samba

4. Add your user to the Samba group

Let’s add the current System user to the SambaShare group, so it can access all files and folders shared under it.

sudo usermod -aG sambashare $USER

set the password for share: This will be different from your system password.

sudo smbpasswd -a $USER

Note: $USER means your current user, if you want to set some other user then change $USER with the particular user name. Also, the file or folder you want to share must be accessible to that particular user.

Alternatively, if you want to  add some other users to the SAMBA group use:

sudo usermod -aG sambashare your-user

To set password:

sudo smbpasswd -a your-user

Lets’ say I want to share the Pictures folder or any other on my Linux Mint that is owned by my current user. So, for that simply go to that folder, right-click on it and select the Share tab.

Share folder over SAMBA on Linux Mint

6. Access the shared folder on Windows or Linux

Now, we can mount the Linux Mint shared folder on other Windows or Linux systems available in the same network or domain.

On Windows 10/8/7

On Linux systems such as Ubuntu, CentOS, and others…

The place to connect the samba server can be different from Linux to Linux, depending upon the desktop environment.

Here we are showing an example for Ubuntu and CentOS using GNOME.

  • Open File Manager
  • Select Other Locations from the right side given panel.
  • At the bottom, in the “Connect Server” box type- smb://server-ip/shared-folder-path
    sambashare folder

If you want to create a new user to access the folder you want to share except it cannot access anything else then follow the below steps:

Create users:

sudo useradd new-user

Add user to Sambashare group

sudo usermode -aG new-user sambshare

Change the folder rights of a folder that you want to share to read and write for all users. So, that our new user can access that.

sudo chmod 777 folder-path

Example- Pictures

sudo chmod 777 Pictures

Now, you can access the shared folder using the new user and its password.

Чтоб разобраться с настройками был переведен файл smb.conf

smb1.conf

smb3.conf

# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# — When such options are commented with «;», the proposed setting
# differs from the default Samba behaviour
# — When commented with «#», the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# «testparm» to check that you have not made any basic syntactic
# errors.

# Пример файла конфигурации для пакета Samba для Debian GNU/Linux.

#

#

# Это основной файл конфигурации Samba. Вам следует прочитать страницу руководства

# smb.conf(5), чтобы понять перечисленные здесь параметры

#. Samba имеет огромное количество настраиваемых параметров, большинство из которых

# не показаны в этом примере

#

# Некоторые параметры, которые часто стоит настроить, были включены в качестве

# закомментированных примеров в этом файле.

# — Когда такие параметры комментируются с помощью «;», предлагаемая настройка

# отличается от поведения Samba по умолчанию

# — При комментарии с помощью «#» предлагаемая настройка используется по умолчанию

# поведение Samba, но этот параметр считается важным

# достаточно, чтобы быть упомянутым здесь

#

# ПРИМЕЧАНИЕ: Всякий раз, когда вы изменяете этот файл, вам следует запускать команду

# «testparm», чтобы убедиться, что вы не допустили никаких базовых синтаксических

# ошибок.

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# ‘interfaces’ option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes

#======================= Глобальные настройки =======================

[глобальные]

## Просмотр/идентификация ###

# Измените это на workgroup/NT-доменное имя, которое ваш сервер Samba будет частью

workgroup = WORKGROUP

# строка сервера эквивалентна полю описания NT

строка сервера = %h сервер (Samba, Ubuntu)

#### Сеть ####

# Конкретный набор интерфейсов/сетей для привязки

# Это может быть либо имя интерфейса, либо IP-адрес/маска сети;

# Обычно предпочтительны имена интерфейсов

; interfaces = 127.0.0.0/8 eth0

# Привязываться только к именованным интерфейсам и/или сетям; для этого необходимо использовать параметр

# «интерфейсы», указанный выше.

# Рекомендуется включить эту функцию, если ваш компьютер Samba

# не защищен брандмауэром или сам является брандмауэром. Однако это

# параметр не может корректно обрабатывать динамические или не широковещательные интерфейсы.

; только привязка интерфейсов = да

#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
max log size = 1000

# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
logging = file

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d

#### Отладка/учет ####

# Это указывает Samba использовать отдельный файл журнала для каждого компьютера

# который подключается

файл журнала = /var/log/samba/log.%m

# Ограничивает размер отдельных файлов журнала (в КБ).

максимальный размер журнала = 1000

# Мы хотим, чтобы Samba регистрировалась только в /var/log/samba/log.{smbd,nmbd}.

# Добавьте syslog@1, если вы хотите, чтобы важные сообщения также отправлялись в системный журнал.

ведение журнала = файл

# Сделайте что-нибудь разумное, когда Samba выйдет из строя: отправьте администратору электронное письмо с запросом возврата

действие паники = /usr/share/samba/panic-action %d


####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are «standalone server», «member server», «classic primary
# domain controller», «classic backup domain controller», «active
# directory domain controller».
#
# Most people will want «standalone server» or «member server».
# Running as «active directory domain controller» will require first
# running «samba-tool domain provision» to wipe databases and create a
# new domain.
server role = standalone server

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# ‘passwd program’. The default is ‘no’.
pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user

 

####### Аутентификация #######

# Роль сервера. Определяет, в каком режиме будет работать Samba. Возможный

# значениями являются «автономный сервер», «сервер-участник», «классический основной

# контроллер домена», «классический резервный контроллер домена», «активный

# контроллер домена каталога».

#

# Большинство людей захотят «автономный сервер» или «сервер-участник».

# Для запуска от имени «контроллера домена active directory» сначала потребуется

# запустить «samba-tool domain provision», чтобы очистить базы данных и создать

# новый домен.

#роль сервера = автономный сервер

#соблюдать ограничения pam = да

server role = standalone server
obey pam restrictions = yes
 

# Этот логический параметр определяет, пытается ли Samba синхронизировать Unix

# пароль с паролем SMB при изменении зашифрованного пароля SMB в

# passdb.

#синхронизация паролей unix = да

unix password sync = yes
 

# Чтобы синхронизация паролей Unix работала в системе Debian GNU/Linux, выполните следующие действия

# параметры должны быть установлены (спасибо Яну Кахану <<kahan@informatik.tu-muenchen.de> за

# отправку правильного сценария чата для программы passwd в Debian Sarge).

программа passwd = /usr/bin/passwd %u

чат passwd = *Введите\snew\s*\spassword:* %n\n * Повторно введите\snew\s*\spassword:* %n\n *пароль\обновлен\успешно* .

# Это логическое значение определяет, будет ли PAM использоваться для смены пароля

# по запросу SMB-клиента вместо программы, указанной в

# «программа passwd». Значение по умолчанию «нет».

смена пароля pam = да

# Этот параметр определяет, как сопоставляются неудачные попытки аутентификации

# с анонимными подключениями

сопоставление с гостевым = плохой пользователь

########## Domains ###########

#
# The following settings only takes effect if ‘server role = classic
# primary domain controller’, ‘server role = classic backup domain controller’
# or ‘domain logons’ is set
#

# It specifies the location of the user’s
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user’s home directory
# (this is Samba’s default)
# logon path = \\%N\%U\profile

# The following setting only takes effect if ‘domain logons’ is set
# It specifies the location of a user’s home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U

# The following setting only takes effect if ‘domain logons’ is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in ‘DOS’ file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser —quiet —disabled-password —gecos «» %u

# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a «machines» group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c «%u machine account» -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup —force-badname %g

 

########## Домены ###########

#

# Следующие настройки вступают в силу только в том случае, если задано значение «роль сервера = классический

# основной контроллер домена», «роль сервера = классический резервный контроллер домена»

# или «вход в домен»

#

# Указывает местоположение учетной записи пользователя.

# каталог профилей с точки зрения клиента) Следующий

# требуется настроить общий доступ [profiles] на сервере samba (см.

# ниже)

; путь для входа = \\%N\profiles\%U

# Другим распространенным выбором является сохранение профиля в домашнем каталоге пользователя

# (это по умолчанию в Samba)

# путь для входа в систему = \\%N\%U\profile

# Следующий параметр вступает в силу только в том случае, если задан параметр «вход в домен»

# Он указывает местоположение домашнего каталога пользователя (с точки зрения клиента

#)

; диск для входа в систему = H:

# logon home = \\%N\%U

# Следующий параметр вступает в силу только в том случае, если установлен параметр «вход в домен»

# Он указывает сценарий, который будет запускаться во время входа в систему. Сценарий должен быть сохранен

# в общем доступе [netlogon]

# ПРИМЕЧАНИЕ: Должно храниться в соответствии с соглашением о формате файла ‘DOS’

; сценарий входа в систему = logon.cmd

# Это позволяет создавать пользователей Unix на контроллере домена через SAMR

# Канал RPC. Команда примера создает учетную запись пользователя с отключенным Unix

# пароль; пожалуйста, адаптируйте к вашим потребностям

; добавьте пользовательский скрипт = /usr/sbin/adduser —quiet —disabled-password —gecos «» %u

# Это позволяет создавать учетные записи компьютеров на контроллере домена через канал RPC

# SAMR.

# Далее предполагается, что в системе существует группа «машины»

; добавить машинный скрипт = /usr/sbin/useradd -g машины -c «учетная запись компьютера%u» -d /var/lib/samba -s /bin/false %u

# Это позволяет создавать группы Unix на контроллере домена через SAMR

# RPC-канал.

; скрипт добавления группы = /usr/sbin/addgroup —force-badname %g

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Some defaults for winbind (make sure you’re not using the ranges
# for something else.)
; idmap config * : backend = tdb
; idmap config * : range = 3000-7999
; idmap config YOURDOMAINHERE : backend = tdb
; idmap config YOURDOMAINHERE : range = 100000-999999
; template shell = /bin/bash

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 means that usershare is disabled.
# usershare max shares = 100

# Allow users who’ve been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes

 

############ Разное ############

# Использование следующей строки позволяет настроить конфигурацию

# для каждой машины. %m заменяется именем netbios

# подключаемого компьютера

; include = /home/samba/etc/smb.conf.%m

# Некоторые значения по умолчанию для winbind (убедитесь, что вы не используете диапазоны

# для чего-то другого.)

; idmap config * : серверная часть = tdb

; idmap config * : диапазон = 3000-7999

; idmap config YOURDOMAINHERE : серверная часть = tdb

; idmap config YOURDOMAINHERE : диапазон = 100000-999999

; оболочка шаблона = /bin/bash

# Настройте параметры usershare, чтобы разрешить пользователям, не являющимся root, предоставлять общий доступ к папкам

# с помощью команды net usershare.

# Максимальное количество usershare. 0 означает, что usershare отключен.

# максимальное количество общих ресурсов usershare = 100

# Разрешить пользователям, которым были предоставлены привилегии usershare, создавать

# общедоступные ресурсы, а не только те, которые прошли проверку подлинности

usershare разрешать гостям = да

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user’s home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to ‘no’ if you want to be able to write to them.
; read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
; create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only «username»
# can connect to \\server\username
# This might need tweaking when using external authentication schemes
; valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the «logon path» option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/homenetwork
; guest ok = yes
; browseable = yes
; create mask = 0600
; directory mask = 0700
read only = no
#
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace ‘lpadmin’ with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin

#======================= Делиться определениями =======================

# Откомментируйте следующее (и измените другие параметры, приведенные ниже, в соответствии с ними)

#, чтобы включить общий доступ к домашнему каталогу по умолчанию. Это позволит использовать общий доступ к домашнему каталогу каждого

# пользователя как \\server\username

;[дома]

; комментарий = Домашние каталоги

; доступно для просмотра = нет

# По умолчанию домашние каталоги экспортируются только для чтения. Измените параметр

# next на «нет», если вы хотите иметь возможность записи в них.

; только для чтения = да

# Маска создания файла установлена на 0700 по соображениям безопасности. Если вы хотите

# создайте файлы с правами доступа group=rw, установите следующий параметр равным 0775.

; create mask = 0700

# Маска создания каталога установлена на 0700 по соображениям безопасности. Если вы хотите

# создайте каталоги. с правами доступа group=rw установите следующий параметр равным 0775.

; маска каталога = 0700

# По умолчанию к общим ресурсам \\server\username может подключаться любой желающий

# имеющий доступ к серверу samba.

# Откомментируйте следующий параметр, чтобы убедиться, что только «username»

# может подключаться к \\серверу\username

# Это может потребовать настройки при использовании внешних схем аутентификации

; допустимые пользователи = %S

# Откомментируйте следующее и создайте каталог netlogon для входа в домен

# (вам также необходимо настроить Samba для работы в качестве контроллера домена.)

;[netlogon]

; комментарий = Служба сетевого входа

; путь = /home/samba/netlogon

; гостевой ок = да

; только для чтения = да

# Откомментируйте следующее и создайте каталог профилей для хранения

# профили пользователей (смотрите параметр «путь для входа» выше)

# (вам также необходимо настроить Samba для работы в качестве контроллера домена.)

# Путь, указанный ниже, должен быть доступен для записи всеми пользователями, чтобы их

# каталог профилей мог быть создан при первом входе в систему

;[профили]

; комментарий = Профили пользователей

; путь = /главная/домашняя

сеть ; гостевой ок = да

; доступен для просмотра = да

; маска создания = 0600

; маска каталога = 0700

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

#

[принтеры]

комментарий = Все принтеры

доступно для просмотра = нет

путь = /var/spool/samba

доступно для печати = да

гостевой ок = нет

только для чтения = да

маска создания = 0700

# Клиенты Windows ищут это имя общего ресурса как источник загружаемых данных

# драйверы принтера

[print$]

комментарий = Драйверы принтера

путь = /var/lib/samba/принтеры

доступно для просмотра = да

доступно только для чтения = да

гостевой ок = нет

# Раскомментируйте, чтобы разрешить удаленное администрирование драйверов печати Windows.

# Возможно, вам потребуется заменить «lpadmin» на название группы, в которую входят ваши

# пользователи с правами администратора.

# Обратите внимание, что вам также необходимо установить соответствующие разрешения Unix

# в каталог драйверов, чтобы у этих пользователей были права на запись в него

; список записей = root, @lpadmin

Как правильно задавать вопросы

Правильно сформулированный вопрос и его грамотное оформление способствует высокой вероятности получения достаточно содержательного и по существу ответа. Общая рекомендация по составлению тем: 1. Для начала воспользуйтесь поиском форума. 2. Укажите версию ОС вместе с разрядностью. Пример: LM 19.3 x64, LM Sarah x32 3. DE. Если вопрос касается двух, то через запятую. (xfce, KDE, cinnamon, mate) 4. Какое железо. (достаточно вывод inxi -Fxz в спойлере (как пользоваться спойлером смотрим здесь)) или же дать ссылку на hw-probe 5. Суть. Желательно с выводом консоли, логами. 6. Скрин. Просьба указывать 2, 3 и 4 независимо от того, имеет ли это отношение к вопросу или нет. Так же не забываем об общих правилах Как пример вот

SaToR

Сообщения: 15
Зарегистрирован: 27 дек 2018, 13:25
Благодарил (а): 1 раз
Контактная информация:

Расшаривание папки в сети Windows на Mint

30 июл 2019, 19:15

Здравствуйте. Опять вопросик возник, как расшарить папку для доступа из виндовс, на mint? Делал вот по этой тривиальной инструкции —

http://alligator.work/%D1%80%D0%B0%D1%8 … untu-mint/

, установил самбу, отредактировал конфиг, но после перезапуска доступа к папке так и не появилось. Попытался из файлового менеджера свойствами на этой папке, с установкой двух галок — разрешить пользователям удалять файлы в этой папке и гостевой доступ, после чего спрашивает сделать ли автоматические права на папку, соглашаюсь, но ругается что не может. Хотел расшарить по сети папку home/ftpuser, чтоб к ней был доступ и по фтп и по сети. Что я не так делаю? Спасибо


Dja

Сообщения: 7069
Зарегистрирован: 27 авг 2016, 20:03
Решено: 30
Откуда: Voskresensk
Благодарил (а): 1368 раз
Поблагодарили: 734 раза
Контактная информация:

Расшаривание папки в сети Windows на Mint

#2

31 июл 2019, 11:32

SaToR, посмотрите сюда
Шарить полностью хомяк я не стал бы и тем более 777.
Если хотите чтоб еще принтера можно было шарить, то добавить

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin


madesta

Сообщения: 2390
Зарегистрирован: 11 июн 2017, 21:47
Решено: 31
Откуда: BY
Благодарил (а): 83 раза
Поблагодарили: 501 раз
Контактная информация:

Расшаривание папки в сети Windows на Mint

#3

31 июл 2019, 15:27

SaToR писал(а): ↑

30 июл 2019, 19:15

расшарить папку для доступа из виндовс

Права на папки, на файлы и на вложенные в папке данные. Тут надо подходить очень вдумчиво и осторожно. Если под собой любимым, то не вопрос, но если под каким анонимом, то получится путаница во владельцах объектов в папке. Так, например, запишет кто под анонимом данные, а потом пользователь Mint под своей учёткой может их и не удалить, так как права для «Остальные» будут «Только чтение». Придётся лезть на свою же локальную папку через сетевое окружение под анонимом и удалять. Или настраивать членство в группах и т.д. и т.п.


Dja

Сообщения: 7069
Зарегистрирован: 27 авг 2016, 20:03
Решено: 30
Откуда: Voskresensk
Благодарил (а): 1368 раз
Поблагодарили: 734 раза
Контактная информация:

Расшаривание папки в сети Windows на Mint

#4

31 июл 2019, 15:33

madesta, не обязательно. Удалить можно с sudo (с рутовыми правами).
Но я считаю, что нужно закрыть пользователя в каталог. Ведь в самом хомяке своя структура каталогов и делать там помойку от всяких анонимусов…думаю не стоит.


madesta

Сообщения: 2390
Зарегистрирован: 11 июн 2017, 21:47
Решено: 31
Откуда: BY
Благодарил (а): 83 раза
Поблагодарили: 501 раз
Контактная информация:

Расшаривание папки в сети Windows на Mint

#5

31 июл 2019, 15:42

Dja писал(а): ↑

31 июл 2019, 15:33

не обязательно. Удалить можно с sudo (с рутовыми правами)

Ничего не могу возразить, кроме как согласиться


2zer0

Сообщения: 175
Зарегистрирован: 23 май 2019, 23:25
Благодарил (а): 24 раза
Поблагодарили: 7 раз
Контактная информация:

Расшаривание папки в сети Windows на Mint

#6

31 июл 2019, 16:32

SaToR писал(а): ↑

30 июл 2019, 19:15

Что я не так делаю? Спасибо


[global]
workgroup = WORKGROUP
idmap config * : backend = tdb
max log size = 1000
dns proxy = No
unix password sync = Yes
usershare allow guests = Yes
passwd program = /usr/bin/passwd %u
log file = /var/log/samba/log.%m
panic action = /usr/share/samba/panic-action %d
syslog = 0
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
map to guest = Bad User
server role = standalone server
os level = 20
usershare owner only = No
server string = %h server (Samba, Ubuntu)
obey pam restrictions = Yes
pam password change = Yes
# Global parameters
[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers

+ Mint пользователь должен быть в группах sambamachines , sambashare
Вся остальная ботва права/доступ и тп выставляются при расшаривании папок


SaToR

Сообщения: 15
Зарегистрирован: 27 дек 2018, 13:25
Благодарил (а): 1 раз
Контактная информация:

Расшаривание папки в сети Windows на Mint

#7

09 авг 2019, 11:06

2zer0 писал(а): ↑

31 июл 2019, 16:32

SaToR писал(а): ↑

30 июл 2019, 19:15

Что я не так делаю? Спасибо


[global]
workgroup = WORKGROUP
idmap config * : backend = tdb
max log size = 1000
dns proxy = No
unix password sync = Yes
usershare allow guests = Yes
passwd program = /usr/bin/passwd %u
log file = /var/log/samba/log.%m
panic action = /usr/share/samba/panic-action %d
syslog = 0
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
map to guest = Bad User
server role = standalone server
os level = 20
usershare owner only = No
server string = %h server (Samba, Ubuntu)
obey pam restrictions = Yes
pam password change = Yes
# Global parameters
[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers

+ Mint пользователь должен быть в группах sambamachines , sambashare
Вся остальная ботва права/доступ и тп выставляются при расшаривании папок

Не увидел в этом конфиге путь до расшареной папки? все принтера только


SaToR

Сообщения: 15
Зарегистрирован: 27 дек 2018, 13:25
Благодарил (а): 1 раз
Контактная информация:

Расшаривание папки в сети Windows на Mint

#8

09 авг 2019, 11:24

Dja писал(а): ↑

31 июл 2019, 11:32

SaToR, посмотрите сюда
Шарить полностью хомяк я не стал бы и тем более 777.
Если хотите чтоб еще принтера можно было шарить, то добавить

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

Вроде все добавил из https://dja.linuxmint.com.ru/wiki/doku.php?id=smb_share , только одну папку со всеми правами, а не две как там, одну с чтением другую без. Но не чего не дало, служба самбы вроде запущена. Но при сканировании этого компа с линуксом по сети, Advanced IP Scaner вижу только расшаренный фтп, и не одной папки.


Dja

Сообщения: 7069
Зарегистрирован: 27 авг 2016, 20:03
Решено: 30
Откуда: Voskresensk
Благодарил (а): 1368 раз
Поблагодарили: 734 раза
Контактная информация:

Расшаривание папки в сети Windows на Mint

#9

09 авг 2019, 13:12

SaToR,

dja@dja-work:~$ smbclient -L 127.0.0.1
Enter WORKGROUP\dja's password: 

	Sharename       Type      Comment
	---------       ----      -------
	pub             Disk      This is a folder accessible from everyone
	Distrib         Disk      This is a folder accessible from everyone
	Instructions    Disk      This is a folder accessible from everyone
	incoming        Disk      This is a folder accessible from everyone
	Documents       Disk      Only dja
	Video           Disk      Only dja
	Pictures        Disk      Only dja
	Download        Disk      Only dja
	Music           Disk      Only dja
	TASU            Disk      Only dja
	print$          Disk      Printer Drivers
	IPC$            IPC       IPC Service (dja-work server)
	MF4700-Series   Printer   Canon MF4700 Series
Reconnecting with SMB1 for workgroup listing.

	Server               Comment
	---------            -------

	Workgroup            Master
	---------            -------
	MEDCENTER        DC2008
	WORKGROUP            DJA
dja@dja-work:~$ 


SaToR

Сообщения: 15
Зарегистрирован: 27 дек 2018, 13:25
Благодарил (а): 1 раз
Контактная информация:

Расшаривание папки в сети Windows на Mint

#10

12 авг 2019, 10:28

Dja писал(а): ↑

09 авг 2019, 13:12

SaToR,

dja@dja-work:~$ smbclient -L 127.0.0.1
Enter WORKGROUP\dja's password: 

	Sharename       Type      Comment
	---------       ----      -------
	pub             Disk      This is a folder accessible from everyone
	Distrib         Disk      This is a folder accessible from everyone
	Instructions    Disk      This is a folder accessible from everyone
	incoming        Disk      This is a folder accessible from everyone
	Documents       Disk      Only dja
	Video           Disk      Only dja
	Pictures        Disk      Only dja
	Download        Disk      Only dja
	Music           Disk      Only dja
	TASU            Disk      Only dja
	print$          Disk      Printer Drivers
	IPC$            IPC       IPC Service (dja-work server)
	MF4700-Series   Printer   Canon MF4700 Series
Reconnecting with SMB1 for workgroup listing.

	Server               Comment
	---------            -------

	Workgroup            Master
	---------            -------
	MEDCENTER        DC2008
	WORKGROUP            DJA
dja@dja-work:~$ 

А если тогда полностью в том конфиге заменить настройки на ваши? или там остальные тоже нужные?


Dja

Сообщения: 7069
Зарегистрирован: 27 авг 2016, 20:03
Решено: 30
Откуда: Voskresensk
Благодарил (а): 1368 раз
Поблагодарили: 734 раза
Контактная информация:

Расшаривание папки в сети Windows на Mint

#11

12 авг 2019, 11:26

SaToR, попробуйте.
Кстати сейчас в секции Global у меня еще присутствует


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

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Docker for windows 10 pro
  • Windows image backup windows server 2012
  • Где хранится резервная копия реестра в windows xp
  • Не удается неявно преобразовать тип string в system windows forms textbox
  • Где хранятся прошивки в 3utools windows 10