How To Samba Share In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Make sure Samba is installed and running on your Linux system. To install, run “sudo apt–get install samba“ and to start the Samba service, run “sudo service smbd start“.
2. Create a folder in your file system which you would like to share using Samba. For example, “sudo mkdir /public“ will create a folder named “public“ in the root directory.
3. Change the ownership of the folder so that Samba can access it. For example, “sudo chown –R nobody:nogroup /public“ will give the “nobody“ user group ownership of the folder.
4. Configure Samba for sharing the folder. Edit the “/etc/samba/smb.conf“ file with the following settings:
[global]
workgroup = WORKGROUP
server string = Samba
Server security = user log
file = /var/log/samba/log.%m
max log size = 5
name resolve order = bcast
hosts allow =
hosts deny =
[Public]
path = /public
browsable = yes
writable = yes
guest
ok = yes
5. Restart the Samba service to apply the new settings. Run “sudo service smbd restart“ to restart Samba.
6. Connect to the shared folder from another computer on the same network. On Windows, open Windows Explorer and navigate to “\\[linux–computer–name]\public“. Replace “[ linux–computer–name]” with the name of your Linux computer. You can also use its IP address instead.
1. Install Samba:
sudo apt-get install samba
2. Configure Samba:
sudo nano /etc/samba/smb.conf
3. Create a Samba User:
sudo smbpasswd -a <username>
4. Create a Samba Shared Directory:
sudo mkdir -p /srv/samba/<sharename>
5. Set the Directory Permissions:
sudo chmod -R 0775 /srv/samba/<sharename>
6. Add the Directory to the Samba Configuration:
sudo nano /etc/samba/smb.conf
7. Restart Samba:
sudo service smbd restart
8. Access the Samba Share from a Remote Machine:
smb://<serverIP>/<sharename>