![]() ![]() If you want to access the shares from a Linux client instead, you’ll need to install the client package first. If doing so from Windows, enter \\hostip\foldername into the Run dialog box.Īs mentioned earlier, Samba is primarily used for accessing Linux files from Windows. sudo ufw allow sambaĪfter allowing Samba traffic through the firewall, you should now be able to access the shares from another system. The easiest way to open these ports on Ubuntu is by allowing the Samba profile. Samba uses UDP ports 137 and 138 and TCP ports 139 and 445. sudo systemctl restart smbdĪfter making such changes, it’s good practice to test smb.conf for any syntax errors. Then, restart the Samba service to apply the new configs. Īfter replacing the directory and usernames, the config should look something like this. sudo nano /etc/samba/smb.confĪdd the following configurations at the end of the file. Once you’ve made a copy of the config file, edit the original with your preferred text editor. It’s a good idea to backup the original config file before making any changes though. Now, we’ll add the smbshare directory that we just created to the Samba config file. We’ll name it smbshare but you can change it to whatever you prefer. You can also set up a shared directory from the terminal, although the process is a bit longer. You can share a folder from your file explorer by right-clicking and selecting Local Network Share.Įnable the Share this folder checkbox, configure the permissions as you see fit, then click on Create Share. We’ll set a password for the current user anup like so sudo smbpasswd -a anup Set Up Shared Directory Then, you’ll be able to access Samba shares as this user. So, you’ll need to add a user to the sambashare group and set a new password for this user. Samba uses its own set of passwords stored in /etc/samba/smbpasswd. Then, install Samba with sudo apt install samba Set Samba Password Update the package index first to ensure you download the latest Samba version. The main Samba package and all the required dependencies can be downloaded directly from the Ubuntu repos, so the initial installation is very simple. We’ll explain how you can set up a Samba server on Ubuntu, as well as how you can access the shared files from other systems in this article. You will be asked for your credentials.Samba is a reimplementation of the SMB networking protocol that enables resource sharing between different platforms (mainly Linux and Windows though). NB: ip-address is the Samba server IP address, whereas sambashare is the name of the share. Open File Manager on Windows and change the file path to: \ip-address\sambashare On macOS: In the Finder menu, click Go > Connect to Server then enter: Regarding Ubuntu: Open the default file manager, click Connect to Server, and then type: NB: Otherwise, the username used will not be saved because it does not belong to a system account. Samba does not use the system account password, so we must create a Samba password for our user account: sudo smbpasswd -a username Configuring User Accounts and Connecting to Share.To allow Samba traffic, update the firewall rules as follows: sudo ufw allow samba Now that we’ve configured our new share, save it and restart Samba for it to take effect: sudo service smbd restart browsable: When this option is enabled, file managers such as Ubuntu’s default file manager will list this share under “Network” (it could also appear as browseable).only read: When the value of this directive is no, permission to modify the contents of the share folder is granted.Then, to save, press Ctrl-O, and to exit the nano text editor, press Ctrl-X. To make the new directory a share, we edit the file as follows: sudo nano /etc/samba/smb.confĪdd the following lines to the bottom of the file: ![]() Samba’s configuration file is located at /etc/samba/smb.conf. ![]() ![]() The preceding command creates a new folder called sambashare in our home directory, which we will share later. Its output should be as follows: samba: /usr/sbin/samba /usr/lib/samba /etc/samba /usr/share/samba /usr/share/man/man7/samba.7.gz /usr/share/man/man8/samba.8.gzĪfter installing Samba, we must create a directory for it to share: mkdir /home//sambashare/ We can determine whether the installation was successful by running: whereis samba To install Samba, we execute: sudo apt update sudo apt install samba If you have everything ready, proceed to the next step and begin the installation process!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |