Samba is a free and open-source software that provides file and print services between different operating systems. In this tutorial, we will learn how to install Samba on Ubuntu Server latest.
Firstly, update your system packages to the latest version using apt-get update
command.
sudo apt-get update
After updating your system packages, upgrade your system to the latest version using apt-get upgrade
command.
sudo apt-get upgrade
To install Samba on an Ubuntu server, use the following command:
sudo apt-get install samba
After installing Samba, you need to configure it. To do that, you will need to create a new Samba user by using the smbpasswd
command:
sudo smbpasswd -a your_user_name
Replace your_user_name
with the name of the user you would like to add to Samba.
Next, navigate to the Samba configuration file by using the command below:
sudo nano /etc/samba/smb.conf
Replace nano
with your preferred command line text editor.
Add the following at the end of the file:
[share]
path = /path/to/your/shared/folder
writeable = yes
guest ok = no
valid users = your_user_name
Replace /path/to/your/shared/folder
with the path of the folder you would like to share.
To apply the changes, you need to restart Samba by using the command below:
sudo systemctl restart smbd
To access your shared folder from another computer or operating system, you will need to use the file explorer and navigate to it using the network location \\your_ubuntu_server_name\share_name
.
Replace your_ubuntu_server_name
with the hostname or IP address of your Ubuntu server, and share_name
with the name of the shared folder that you have configured.
Congratulations! You have now successfully installed Samba on Ubuntu Server latest and created a user and shared folder.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!