![]() To apply the changes, restart the Samba service on Debian 11: sudo systemctl restart nmbd Configure Firewall for Samba # sudo touch /private/ demo1.txt /public/ demo2.txt you can run the following commands: # sudo mkdir /private/ demo-private /public/ demo-public Create Demo Files in Samba ShareĪt this point, you can create demo files in the Samba shares. Valid users = means that everything is configured appropriately. Passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully*. Panic action = /usr/share/samba/panic-action %d Press enter to see a dump of your service definitions Load smb config files from /etc/samba/smb.conf When you are done with the above steps, you can test your Samba configuration on Debian 11 that is working correctly or not with the following command: sudo testparm Output Then, add the user to the Samba share group on Debian 11 with the following command: sudo usermod -aG smbshare sambauserįinally, set a password for your Samba user: sudo smbpasswd -a sambauser OutputĮnable the created account by using the following command: sudo smbpasswd -e sambauser Now you should create a no-login local user to access the private share by using the command below: sudo useradd -M -s /sbin/nologin sambauser ![]() This allows newly created files to inherit the parent group. Note: The value 2 at the beginning of the above commands, stands for the SGID bit. Next, set the correct permissions for the directories: # sudo chmod 2770 /private/ Set the correct permissions for the private share by using the commands below: # sudo chgrp -R smbshare /private/ Create Samba Share User GroupĪt this point, you need the Samba share user group to access the Private share as specified in the config file above.Ĭreate the group by using the command below: sudo groupadd smbshare When you are done, save and close the file. Now you need to open the Samba config file again and add the shares and authentication methods to the end of the file. So you can create the two directories by using the following commands: # sudo mkdir /public Create Shared Samba DirectoryĪt this point, you can share both public and private directories. Under the Global section, find the line below and make sure it is like this: workgroup = WORKGROUP Set Samba Global SettingsĪt this point, you need to open the Samba configuration file with your favorite text editor, here we use vi: sudo vi /etc/samba/smb.conf Configure Samba on Debian 11Īt this point, you need to make some changes to the Samba config file and create share samba directories. This will install the dependencies and required packages. Then, use the following command to install Samba: sudo apt install samba smbclient cifs-utils First, update your local package index with the command below: sudo apt update Samba packages are available in the default Debian repository. Now follow the steps below to set up Samba share on Debian 11. To do this, you can follow our guide on Initial Server Setup with Debian 11. ![]() To complete this guide, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. Steps To Install and Configure Samba Share on Debian 11
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |