Temporarily mount Windows share via cmd line? (Ubuntu 11.04)

2

1

What is a simple way to (temporarily) mount a windows share from within Ubuntu 11.04 via the command line?

Basically, I'd like the path /home/myuser/windowsbox to map to a windows share. (Need to supply user/pass/domain)

Most of the tutorials I can find use fstab for a permanent mapping. The GUI options do not let me specify a local path for the mounting.

Thank you

nonot1

Posted 2011-10-05T15:24:37.630

Reputation: 1 489

Answers

5

Just use mount -t cifs to do it from command line. Consult manpage for mount to learn about additional options like user/password/explicit filename encoding/file ownership etc. You would unmount it using umount /home/myuser/windowsbox

In particular see the uid/gid options. This will let normal users access the share.

There's also smbfs as mount type but please don't use it since it's being obsoleted by cifs.

vtest

Posted 2011-10-05T15:24:37.630

Reputation: 4 424

2

Open a command line and enter the following.

smbmount //MYWINBOX/MYSHARE /mnt/winstuff -o username=domain//username 

From here you should be able to enter your password and mount your volume.

Tim Brigham

Posted 2011-10-05T15:24:37.630

Reputation: 1 102

On my machine I get the error: mount.cifs: permission denied: no match for /home/myuser/windowsbox found in /etc/fstab – nonot1 – 2011-10-05T22:11:24.847

1

What is the name of your Windows share that you're trying to map? This is how I've done temporary mapping (substitute //mywinbox/myshare with the network path to the widows share you want to map and with the username credentials to connect to your Windows box):

sudo mount -t cifs //mywinbox/myshare /home/myuser/windowsbox -o username=<username>

It would probably be recommended that you house your mappings in a more established location such as /mnt/windowsbox then perhaps create a symlink in the /home/myuser directory. Just a thought for consistency.

relder251

Posted 2011-10-05T15:24:37.630

Reputation: 11