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

link|improve this question

57% accept rate
feedback

2 Answers

up vote 4 down vote accepted

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.

link|improve this answer
4  
+1 for the obsoletion reminder on smbfs. – Tim Brigham Oct 5 '11 at 15:38
feedback

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.

link|improve this answer
On my machine I get the error: mount.cifs: permission denied: no match for /home/myuser/windowsbox found in /etc/fstab – nonot1 Oct 5 '11 at 22:11
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.