How to share with SAMBA on any GNU / Linux distribution

Some distros do not have the facility that UBUNTU gives us to share folders using SAMBA, let's see how to create a basic setup where you don't need to enter a username / password and it works on any GNU / Linux distribution.


You just have to install SAMBA from the official repositories with your preferred package manager:

We enter as root in a terminal:

su (root password)

Sabayon:

equal i samba

Arch:

pacman -S samba

Gentoo:

samba emerges

Then SAMBA needs to be added to the running services.

Always as root ...

Sabayon / Gentoo:

rc-update add samba default

Arch:

systemctl enable smbd.service
systemctl enable nmbd.service

Finally, you have to edit the configuration file /etc/samba/smb.cfg. Sometimes it is better to create a new one, so we can rename or delete the existing one.

mv /etc/samba/smb.cfg /etc/samba/smb.cfg.copy
nano /etc/samba/smb.cfg

[global] workgroup = WORKGROUP
netbios name = SambaServer
server string = Linux
log file = /var/log/samba/log.%m
maxlogsize = 50
map to guest = bad user
socket options = TCP_NODELAY SO_RCVBUF = 8192 SO_SNDBUF = 8192
localmaster=no
dns-proxy=no

[Shared] path = / home / user / Shared
public = yes
only guest = yes
writable = yes

And that's it, when you restart you will be able to access your shared folder from any device on your network without a password or user. Obviously, it is not the most secure setting, but it is often the most appropriate.


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.