Generally speaking, Samba is the answer to most Windows-Linux file sharing questions.
Though, the full-blown samba package may not be necessary. If all you need to do is connect to an existing Windows share, you only need the smbmount
command. If you are using a Debian-based distribution, you can get smbmount through your package manager by installing the smbfs
If you like using the command line:
apt-get install smbfs
You will need to be root when you execute that command. If you are using an Ubuntu distribution, you usually just need to put "sudo" at the front of it.
Once installed, you mount the Windows share into your Linux filesystem just as you would any other drive. So, create a directory to serve as a mount point, and (as root) issue the following command:
smbmount //servicename/sharename mount_point
with the name or IP address of the computer providing the share.
with the name of the share you want to access.
with the directory you created earlier.
If the command is successful, you will see no error messages (or output of any kind), but listing the contents of mount_point
should show all the directories/files provided in the share.
If you get an error when trying the command with a computer name for servicename
, try the command again with an IP address. There may be an issue with Linux communicating with the WINS server on your network to translate the name to an IP.
Lastly, if you want to provide your Windows machines with access to your Linux machine's files, you will
need to setup the full-blown samba package to do so.