Server: Ubuntu SAMBA 3 Client: Ubuntu 12.04

I can access the shares using Nautilus but I can't mount the same share using shell.

I issue the following command:

sudo mount -t cifs //auth.local/Aplicacao /home/josir/fontes -o rw,credentials=/home/josir/.smbcredentials,iocharset=utf8,codepage=unicode,uid=1000,gid=1000

The share is mounted but I could not see any subdirectory. I tried to find out why issuing:

josir@MEDIA35:$ ls -ls | grep fontes
0 drw-rws--- 13 josir josir      0 Out  4  2011 fontes

josir@MEDIA35:$ ls -ls fontes
ls: impossível acessar fontes/Software: Permissão negada
ls: impossível acessar fontes/Doc: Permissão negada
ls: impossível acessar fontes/Scripts: Permissão negada
ls: impossível acessar fontes/HmlFontes: Permissão negada

What am I missing ?

What's the correct mount command to get access to this samba share?

Do I have to use the same uid/gid of the samba user ?

  • Have you checked the share permissions and the user permissions? My spanish is rusty, but it looks like it mounts ok, but that you then get access denied errors. – Univ426 Aug 29 '12 at 19:25
  • You almost get it - it's portuguese :) – Josir Aug 30 '12 at 23:07
  • When I issue the ls -ls is exactly to discover what permission I had on directory, that is. It's the correct permission but it's not the same gid/uid of samba server. – Josir Aug 30 '12 at 23:09
  • Is SELinux turned on and enforcing? – Eli Aug 31 '12 at 1:42
  • How do I know if SELinux is turned on? – Josir Sep 14 '12 at 19:28

1) Create a directory for your mount

mkdir ~/share

2) Create a group with the same gid of your "Domain Users" group defined on your Samba Server:

sudo groupadd domain_users -g 1901
sudo addgroup josir domain_users

3) Mount using mount.cifs utility:

sudo mount.cifs //server/sharepoint ~/share -o user=josir dom=mediasys 


  • To see if it works, you should logout and login (due to the addgroup command)
  • To install mount.cifs: sudo apt-get install cifs-utils
  • If you could not access the ~/share directory, pass (2) didn't work well...
  • To know the gid Domain User, issue item (3) and then:

    ls -lsn | grep share

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.