Is there a step-by-step tutorial that instructs in detail how to smbmount a Samba share to be used by a non-root user on a Ubuntu 10.04 desktop?

Note: there are numerous threads on Google search dealing with this seemingly new problem. Instructions that used to work on Ubuntu 8.04 (or an older version of smbfs) no longer work.

I need to find something that's up to date and reproducible.

6 Answers 6


A very nice tool to easily mount your samba shares in your home folder is SMBNetFS. With this tool you can access your samba shares by nearly all applications simply through a mount point in your home.

How to use SMBnetFS:

  • Install the package through your package manager
  • cp /etc/smbnetfs.conf ~/.smb/smbnetfs.conf copy standard configuration
  • cp /etc/samba/smb.conf ~/.smb/smb.conf copy samba configuration
  • mkdir ~/sambashare or any other name for the mount point
  • smbnetfs ~/sambashare mount the shares to the mountpoint

Unfortunately there is only little documentation available. See man smbnetfs for options and go through the FAQ file in /usr/share/doc/smbnetfs.

  • +1 for the detailed steps. I hope this works with Eclipse, because with gvfs Eclipse definitely doesn't work. Do you happen to know how SMBnetFS is different from smbfs? Commented Feb 1, 2011 at 23:14
  • 2
    SMBNetFS uses fuse. Make sure users are in the fuse group.
    – Takkat
    Commented Feb 1, 2011 at 23:23
  • +1 again! Doesn't gfvs use FUSE as well? How is it different from what I already have prepackaged (gvfs) with my GNOME desktop? Commented Feb 1, 2011 at 23:38

When using gnome, you can simply type in the smb:// url into Nautilus. Normally gvfs-fuse and other gvfs packages should be installed, so that you can mount samba directly with the file browser. Additionally you should find all mounted stuff in your ~/.gvfs folder. This even works with other protocols and compressed files etc.

gvfs-mount smb://user@server/storage

I've tested it with eclipse and other tools and it works. gvfs-fuse must be installed.

  • Thanks but Eclipse won't work with this. I tried this already, that's why I was specifically asking about smbmount (a symbolic link to mount.cifs which is part of the smbfs package). Commented Feb 1, 2011 at 23:09
  • 3
    So eclipse can't access .gvfs in your home dir? As far as I know, every program should be able to do this. Correct me if I'm wrong. Commented Feb 2, 2011 at 9:23
  • Nowadays it's gio mount instead of gvfs-mount. See man gio or here for details.
    – makeworld
    Commented Jul 21, 2021 at 22:58

In 2022

For scripting

If you need to mount a remote smb share locally, you can use the gio toolkit. It isn't handy if you want to view the remote share in a file manager, but it's very useful in scripting.

gio mount --anonymous "smb://servername/share"
gio copy --progress "smb://servername/share/filename.ext" /local/folder/
gio mount --unmount "smb://servername/share"

gio does not require superuser privileges, reads quoted strings with spaces normally, and works with Cyrillic characters.

In Ubuntu 22.04 gio is installed by default.

...But if you need to work with files in the file manager, especially in Dolphin

In this case you can use smb4k.

sudo apt install smb4k

This program connects to smb:// shares anonymously or with credentials, can mount shares at startup, has profiles and a lot of settings. But most importantly, it allows you to work with files in Dolphin directly, without caching it, as if they were stored locally. So you can use, for example, kid3 to edit remote files.


man mount will help you determine what options you want. If the windows system will always be available. You can just add the mount to the /etc/fstab and it will be mounted. You can allow the user to mount and unmount the partition as required using the options user,noauto. To allow others to unmount it change user to users.

Autofs also supports on demand mounts using samba. The incantation depends on which directories you want mounted when. I've run it successfully in a development environment.

EDIT: If you need to do this for a lot of users, I suggest using autofs to do the mounting. This does not require changes to fstab. Obtaining credentials for the various users may be a problem. I use a directory structure in the form /net/$HOST/$USER for my mounts. Autofs is configured for the /net/$HOST portion of the mount and automatically mounts the directories under it as needed.

Particular mounting approaches depend on your needs. I have had cases where users needed their Desktop directory mounted on the server, although typical mounts are server based.

For large organization with lots of user it may make sense to move the directories to a Linux server and use Samba to share the files to Windows users. I haven't tried the reverse, but it may be possible.

  • This works, but you need root access to change fstab. Even if are root, note that it is quite impractical if you have to do it for a lot of users, each with a specific share to mount (as in a large organization where each user has a personal share in a centralized file server).
    – user46513
    Commented Feb 15, 2012 at 13:11

I found this question while researching the magic I performed recently to do exactly this for one of my users. My workflow differs remarkably to the other answers. Do note, however, this is about the most simple case possible.

Assuming your username is ae and your home is /home/ae

1) Set up smbfs:
mkdir /home/ae/.smb

1a) If windows login credentials are needed, create and edit the file: /home/ae/.smb/smbnetfs.conf to have contents:

auth winuser "winpassword"

winuser is the user created on the Windows computer you wish to access. winpassword is that user's password to log in to Windows on that computer.

2) Create your mount point:
mkdir /home/ae/nethood

3) Execute the smbnetfs command:
smbnetfs /home/ae/nethood

Note the entire "network neighborhood" will show up under /home/ae/nethood with the workgroups being the first layer of subdirectories.

All of the listings below were copied from my browsing of folders as a non privileged user on an ubuntu host. Username and group changed to ae. sudo was never used. The Windows computers are on informal Windows network and shared folders are user/password protected (on the Windows computer using the windows username and password).

$ cd nethood
$ ls -alh
total 12K
drwxrwxrwx 9 ae   ae     0 Dec 31  1969 .
drwxr-xr-x 9 ae   ae    21 Jul 28 11:49 ..
drwxrwxrwx 2 root root   0 Dec 31  1969 WORKGROUP

Browse the workgroup WORKGROUP:

$ ls -alh
total 0
drwxrwxrwx 2 root root  0 Dec 31  1969 .
drwxrwxrwx 9 root root  0 Dec 31  1969 ..
lrwxrwxrwx 1 root root 11 Dec 31  1969 HTPC -> ../HTPC
lrwxrwxrwx 1 root root 14 Dec 31  1969 NEWPC -> ../NEWPC

Change directory to computers and any shared folders will be listed and accessed as normal.

$ cd NEWPC
$ ls -alh
total 0
drwxrwxrwx 2 root root 0 Dec 31  1969 .
drwxrwxrwx 9 root root 0 Dec 31  1969 ..
drwxrwxrwx 2 root root 0 Dec 31  1969 Desktop
drwxrwxrwx 2 root root 0 Dec 31  1969 Users

And the files:

$ cd Desktop/
$ ls -alh
ls: cannot access desktop.ini: No such file or directory
total 30M
drwxrwxrwx 2 root root     0 Dec 31  1969 .
drwxrwxrwx 2 root root     0 Dec 31  1969 ..
-rwxr--r-- 1 ae   ae    1.5K Jan 25  2013 Command Prompt.lnk
-????????? ? ?    ?        ?            ? desktop.ini
-rwxr--r-- 1 ae   ae    156K May 28  2013 Download %25285%2529.iif
-rwxr--r-- 1 ae   ae    2.4K Jul 24 12:28 Google Chrome.lnk
-rwxr--r-- 1 ae   ae     178 Feb  4  2013 import orders.bat
-rwxr--r-- 1 ae   ae    2.3M Mar 30  2012 msvc2008_x86_vcredist_x64.exe
drwxr-xr-x 2 ae   ae       0 May 20  2014 OpenOffice 4.1.0 (en-US) Installation Files
-rwxr--r-- 1 ae   ae    406K Jun  6  2013 Paypal_Jan_1_2012_to_Dec_31_2012.iif
-rwxr--r-- 1 ae   ae     15M May  8  2012 php-5.4.3-Win32-VC9-x86.zip
-rwxr--r-- 1 ae   ae    1.9K Jul 24 13:03 PSPad.lnk
-rwxr--r-- 1 ae   ae    1.1K Jul 24 12:31 VB Demo.lnk

Notice the above directories have ownership root root. File ownership will be the same as your user.

No other users will be able to access the folders regardless of the mount point or that folder's ownership or permissions. If your user can "write" to that folder (and it is empty), smbnetfs will mount the network neighborhood there and not allow anyone else access, even root. For root to have access, you must su ae.

If there are no shared folders, the computer's directory will be empty.

If you do not have credentials to the Windows computer, you may get the error:
ls: cannot open directory .: Input/output error


In Ubuntu I used the package cifs-utils per this article: How to Mount Samba share in Ubuntu Linux.

I wanted a mount point under my home directory. It's for non-media files. I created an entry in /etc/fstab. It was owned by root, though, and I couldn't edit in that location.

The answer was in the man page for mount.cifs. I added to fstab the option uid=MyUserName. My user name on the cifs client is the same as on the cifs host. I don't know if that is a requirement, but it worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .