Mounting a Network Drive (SMB) on Ubuntu

You can mount a shared folder on Windows to a Linux machine with smbclient:

sudo apt install smbclient

Assuming the documents folder is shared with Windows user james on the Windows machine at 192.168.1.5, it can be mounted on the filesFromWindows directory of user ubuntu’s home directory:

sudo mount -t cifs -o username=james //192.168.1.5/documents /home/ubuntu/filesFromWindows/

If you get an error saying “mount: /home/ubuntu/filesFromWindows/: cannot mount //192.168.1.5/documents read-only.”, you’ll also need the cifs-utils package:

sudo apt install cifs-utils