I've got a shared folder on a Windows computer, and I'd like to mount it on a server running Ubuntu Server.
How can I mount a samba drive from the command line?
I've got a shared folder on a Windows computer, and I'd like to mount it on a server running Ubuntu Server.
How can I mount a samba drive from the command line?
First, unless already installed, install
cifs-utils
as follows:Then, choose a path where to place a file containing the credentials to access your shared folder. Let's say
/home/.smbcredentials
, as an instance.So, open that file and write your credentials as follows:
Also, decide where to mount your shared folder. Let's say
/myfolder
, as an instance.Now, assuming you want your network folder to be accessible as soon as your Linux system is started, edit the
/etc/fstab
file. You can usenano
as follows:Then, you should be able to see something already written to that file. Therefore, just append one line to the bottom:
That's all, reboot your Linux system by typing
reboot -f
and your network drive will be mounted.As an alternative to rebooting, running
/etc/fstab
as superuser should work: