How to Install Samba Server

To install Samba server, make sure that the following ports are open:

  1. TCP 139 and 445
  2. UDP ports 137 and 138

Here are the steps to install the Samba server:

  1. Install the Samba server with the following command:
$ sudo apt-get update

$ sudo apt-get install samba -y
  1. After installation is complete, you can check the Samba version with the

following command:

$ smbd --version
  1. Next, we need to configure Samba to enable sharing on the network. First, create a

backup of the original configuration file:

$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
  1. Next, open smb.conf and replace its contents with the following:
workgroup = WORKGROUP
server string = Samba Server
netbios name = ubuntu
security = user
map to guest = bad user
dns proxy = no
path = /var/samba/shares/public
browsable =yes
writable = yes
guest ok = yes
read only = no
create mask = 644
  1. Next, we need to create a shared directory:
$ sudo mkdir -p /var/samba/shares/public
  1. Change the directory permissions to make it world-writable:
$ sudo chmod 777 /var/samba/shares/public
  1. Restart the Samba service for the changes to take effect:
$ sudo service smbd restart

Leave a Reply

Discover more from BHUTAN IO

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top