There is Linux server that shares a folder with Windows client but there're also Linux client machines. I am using KDE and can mount from Dolphin and then do with files and folders as permissions allows:


But i need to mount the way i can access it as a regular path(from console, LibreOffice, mail client etc) and on any DE.

mkdir /media/sambaShare
smbclient --user=username -L  //server_address

This part works, it shows me Samba server, what folder is shared etc.

mount -t cifs //server_address/share_folder_name -o username=username /media/sambaShare

And it seems it mounts everything ok. But when i try to access the folder i get:

cannot open directory /media/sambaShare/: Permission denied

It allows accessing as root but not user. How come via Dolphin i can access as a user but regular way mounting doesn't work? I created the same group on client as in server that can access that folder and as user finally i could went into that folder and see other folders but no further. I can even add files but not edit them.

I'm using Samba Server 3.6.3 on Ubuntu server 12.04 Client machine Kubuntu 14.04

1 Answer 1


You probably need to add the uid=your-user-id option to your mount command. You may also need to add forceuid to ignore the user IDs coming from the server (Samba offers a SMB extension to make Unix permissions work as expected; only Unix-like clients request it.) There are similar options for the group ID (gid & forcegid).

Why? Since normal mounts are system-wide, your local kernel is enforcing permissions. Otherwise, any user on the system could access the share. The default, if you don't pass uid/gid is the user who ran mount—most likely root.

See the mount.cifs man page for all the CIFS-specific mount options.

  • Thank you it worked! Didn't have to go as far as forcegid, passing uid & gid was enough. Aug 18, 2015 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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