Samba is a software suite that provides file and print services over the SMB/CIFS protocol. It is used to share files and printers between Linux and Windows systems.
Here are the steps to configure Samba in Ubuntu:
Install Samba:
arduinosudo apt-get install sambaCreate a directory to share:
arduinosudo mkdir /home/shareAssign permissions to the directory:
bashsudo chmod 777 /home/shareNote: This is not a secure setting, but for the sake of simplicity, we are using it for this example.
Open the Samba configuration file:
bashsudo nano /etc/samba/smb.confAdd the following lines at the end of the file:
arduino[share] comment = Ubuntu File Server Share path = /home/share read only = no browsable = yesHere,
shareis the name of the share,Ubuntu File Server Shareis the comment that appears when browsing the share,/home/shareis the directory path that is being shared, andread only = noandbrowsable = yesallow both read and write access to the share.Save and close the file by pressing
Ctrl+X, thenY, and finallyEnter.Create a Samba user:
csssudo smbpasswd -a usernameReplace
usernamewith the desired Samba username. You will be prompted to set a password for the user.Restart the Samba service:
sudo systemctl restart smbd
That's it! You can now access the Samba share from a Windows machine using the Ubuntu file server IP address or hostname.
No comments:
Post a Comment