Skip to content
www.mytechnote.ru
Menu
  • Administration
    • Scripts
  • Equipment
    • Reviews
    • Instructions
  • Other
  • English
    • English
    • Русский
Menu

How to make a shared folder in linux, setting samba

Today I’ll show you how to share folders in Ubuntu for home networks, so that you can go to your folders in linux, for example from a Windows computer.

So, let’s start.

Install samba:

sudo apt-get update
sudo apt-get install samba

After the samba is installed, you need to fix the config. For this we type:

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
sudo nano /etc/samba/smb.conf

Insert the following lines to the file:

[global]
workgroup = WORKGROUP
server string = servername 
netbios name = SERVERNAME
#servername should be <span class="short_text" id="result_box" lang="en"><span>replaced with your host name</span></span>
log file = /var/log/samba/%m.log
max log size = 50 
security = user 
#<span class="short_text" id="result_box" lang="en"><span>prohibit guest access</span></span>
map to guest = Bad User
dns proxy = no

#enable symlinks following
unix extensions = no
wide links = yes
follow symlinks = yes

# utf encoding
dos charset = cp866
unix charset = UTF8

# disable printers
load printers = no
show add printer wizard = no
printcap name = /dev/null
disable spoolss = yes
# <span class="short_text" id="result_box" lang="en"><span>You can restrict access to addresses / networks</span></span>
# hosts allow = 127. 192.168.24.

# <span id="result_box" lang="en"><span>By default, all files starting with a dot will have the attribute "hidden"</span></span>
hide dot files = yes

#adding a share
#shared <span class="short_text" id="result_box" lang="en"><span>folder name</span></span>
[system_trash]
#path to it
path = /mnt/system_trash
guest ok = no
read only = no
browsable = yes
writeable = yes

Next, you need to see what would be the name of your host corresponded to the ip address of this host:

sudo nano /etc/hosts

There should be a line like:

192.168.1.100 servername

After that, save the file (in the nano – key combination ctrl + x) and restart the samba:

sudo /etc/init.d smbd restart
sudo /etc/init.d samba restart

Next, you need to add the user to samba users (the user should exists on the system). Add a new user to the system and samba:

sudo adduser user
sudo smbpasswd -a user

After the user is added you can try to go to our share from the Windows machine. We enter the user’s login and password. Our share will have to open.

For your reference – to see samba users you need to type the following command:

sudo pdbedit -L -v

To remove Samba user:

sudo smbpasswd -x user

Video on the topic:

Posted on 07.08.201730.05.2024 by sanglyb

Post navigation

← How to disable IPv6 in Ubuntu
How to remove a service in Windows →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Подписывайтесь

Youtube
vk
telegram
github
twitter
rss
  • Форум
  • Об авторе
  • Поддержать автора

Популярные записи

Новые записи

  • How to Extend an LVM Partition in Linux
  • SCCM Reporting Errors After Migrating from SQL Server 2016 to 2019
  • Problem Using PassFiltEx on Older CPUs
  • How to remove attachments from old calendar events in Exchange using a script
  • How to download and install Office 2024 LTSC

Архивы

  • 2026 (3)
  • 2025 (5)
  • 2024 (7)
  • 2023 (30)
  • 2022 (4)
  • 2020 (17)
  • 2017 (82)
  • 2016 (5)
© 2015-2026 www.mytechnote.ru
Использование материалов сайта возможно только с разрешения владельца или обязательна индексируемая, прямая, передающая вес ссылка на материал.