Sharing Linux Folders with Windows through Samba
If you use a Linux VPS, sometimes you would want to make a folder in it accessible from Windows. One of the best ways to do that is to use Samba. In this article, we are going to see how to do that. We assume here that you are logged into your Linux VPS, as user root.
Make sure you allow access to ports 445 and 139 on your Linux VPS, as Samba uses those ports. So, adjust your Firewall settings accordingly.
Check if Samba is already installed and running on the Linux VPS by typing
service smbd status. If you get a not found message, it means Samba is not installed. So, install it by typing the following.
apt-get update
apt-get install samba
Now add user
rootand give a password to it for accessing shared folders, by typingsmbpasswd -a root.Now create the folder you want to share if it doesn't already exist. Let us assume, you want to share the folder
/root/sharedfolder. In that case, you will first create it by typingmkdir /root/sharedfolder.Now using vi, open file
/etc/samba/smb.confby typingvi /etc/samba/smb.confand add the following content at the end of it. You will need to pressifor inserting text. Herethesharedfolderis the name by which you would access the folder/root/sharedfolderfrom your Windows computer.
[thesharedfolder]
path = /root/sharedfolder
available = yes
valid users = root
read only = no
browsable = yes
public = yes
writable = yes
Restart the Samba service by typing
service smbd restart.Now you should be able to access this folder from your Windows computer. To do that, create a new shortcut and type
\\ip_address_of_the_node\thesharedfolderas location.ip_address_of_the_nodehere is the IP address of the node where you created the shared folder. When Windows prompt your for credentials, selectMore Choicesand click on the optionUse a different account. There, type the username asrootand the password the one that you had set for the userrootfor Samba.
Leave Sharing Linux Folders with Windows through Samba to:
Read more #technology posts
Best Posts From hmushtaq
We have not curated any of hmushtaq's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From hmushtaq
- My trip to Instanbul
- Sharing Linux Folders with Windows through Samba
- My trip to Jurassic Kingdom
- My trip to Plaswijkpark
- Which teams do you think would reach the Quarter finals of the 2018 Football World Cup?
- Does Japan deserve to be in the 2nd round?
- I have made a site to check the prices of Cryptocurrencies
- Coinmarket showing the value of SBD almost twice as much as the original!
- My trip to Grenoble, France
- Some useful Docker commands