This tutorial provide how to configure directory as network share on Linux machine. After configuration finished, you may exchange files between any operating systems (Windows, MacOS and Linux) by network. Samba will help us with this. So, what is Samba? View official page.
Samba is the standard Windows interoperability suite of programs for Linux and Unix.
Samba is an important component to seamlessly integrate Linux/Unix Servers and Desktops into Active Directory environments. It can function both as a domain controller or as a regular domain member.
Samba is a software package that gives network administrators flexibility and freedom in terms of setup, configuration, and choice of systems and equipment.
Installing Samba in Debian based distros:
sudo apt install samba -y
Most users are running packages shipped with their distribution or from 3rd parties, such as SerNet (Samba+/Enterprise). However, in some situations you may decide to compile Samba yourself, for reasons such as:
- outdated packages are shipped with your distribution;
- no packages are available for your distribution or OS;
- you want to apply a patch from a developer to fix a problem before a new version is released.
Create folder which must be shared:
mkdir /home/user/share
Add configuration, which tell to Samba service about share name, path, pubic status, writable or not in bottom of /etc/samba/smb.conf
file:
[share]
path = /home/user/share/
public = yes
writable = yes
Attention! This configuration means that your folder is public and has access without authentication.
If you want authenticate users with password add following line in /etc/samba/smb.conf
file:
valid users = your_user
and change public
value to no
.
Create new user for Samba service:
sudo smbpasswd -a your_user
And enter new password.
Then you need start samba daemon:
sudo systemctl start smbd
And (if you need) enable it in autorun:
sudo systemctl enable smbd
If you use UFW firewall you need to open 139 and 445 ports:
sudo ufw allow 139
sudo ufw allow 445
Are my posts is helpful? You may support me on Patreon.
Top comments (0)