Sign in with
Sign up | Sign in
Your question

Samba not quite right in Ubuntu 10.04

Tags:
  • NAS / RAID
  • Ubuntu
Last response: in Linux/Free BSD
Share
May 10, 2010 5:23:11 PM

Hi

I have a problem accessing certain folders on my NAS server when mounting through fstab from my Ubuntu 10.04 machine:

I have the following lines in /etc/fstab
  1. //myNASserver/userstew /media/userstew smbfs username=myusername,password=password
  2. //myNASserver/linkmusic /media/music smbfs username=myusername,password=password

When I then user File Browser to click on the mounted folder for userstew, I am told:

  1. The folder contents could not be displayed.
  2. You do not have the permissions necessary to view the contents of "userstew".

Although the music folder works perfectly.

Note, when I use File Explorer and click, Go, Network, myserver, userstew I get full and proper access to everything. If I umount /media/userstew I can right click on the folder and manually mount it (albeit not under /media).

I've looked at my SAMBA setup on my NAS Server, to consider the differences between the shares:

  1. [linkmusic]
  2. comment = Music for everyone
  3. writeable = yes
  4. invalid users = mail,daemon
  5. create mode = 777
  6. path = /mnt/disk1/linkmusic
  7. directory mode = 777
  8.  
  9. [userstew]
  10. comment = Stews user area
  11. writeable = yes
  12. invalid users = mail,daemon
  13. create mode = 770
  14. path = /mnt/disk1/userstew
  15. directory mode = 770

As you can see I am deliberately allowing everyone access to the music (777), but not to my area (770). I want to retain this security, but allow myself access to my own folders!

Any idea how I can get access set up correctly?

Thanks,

Stew

More about : samba ubuntu

May 12, 2010 2:14:38 AM

I'm no expert in linux, but you need to set the permissions on the folders for users and/or groups.

770 is for execute=7, write=7 and read=0, so you don't have read permission.

you need to set the permissions for your user only with 777 and you remove every other users or groups.
Related resources
May 12, 2010 4:42:36 AM

nocteratus said:
I'm no expert in linux, but you need to set the permissions on the folders for users and/or groups.

770 is for execute=7, write=7 and read=0, so you don't have read permission.

you need to set the permissions for your user only with 777 and you remove every other users or groups.


Thats not quite correct. In Linux, the file permission are organized into user, group, and other. When represented by number, the first number represents the permissions for the files user, the second is the permission for the group the file belongs to, and the third is the permissions for everyone else.

The number are (r - read, w - write, x - execute):
0 - ---
1 - --x
2 - -w-
3 - -wx
4 - r--
5 - r-x
6 - rw-
7 - rwx


@OP are the file permissions set up correctly in the samba share (does the user you are logging in as have permission to view the files).

Also, if I'm not mistaken (which i very well may be, i don't claim to be an expert) i think 'cifs' has all but replaced 'smbfs' when for accessing samba stuff. Have you tried mounting the samba file system using cifs?
May 13, 2010 7:17:25 PM

Many thanks, I have indeed got this working by setting the "other" settings to be rwx. However, this still does not seem correct to me. Almost certainly my understanding of the interaction between the NAS users and SAMBA users - I need to spend some (a lot) of time reading....

My expectation is that the folder I want everyone to have access to (music), should have permissions of rwxrwxrwx.

Whilst my own personal folder should have permission rwxrwx--- On the NAS box this works, my username can access, my wife can access as her username is in the same group as myself, but the children can not access.

We then have the same usernames set up in SAMBA, but the access is not consistent.

Also saw the note about CIFS.....not come across this....so as I say, I need to spend time researching properly....

Thanks,

Stewart
May 13, 2010 7:29:31 PM

I have a connection to a samba share on my laptop at home. It has been a while sense I set it up but i have a feeling that there was something else i had to do to be able to access files correctly from my user. When i get home, ill pull that up an post it here, if you want to compare it to what you currently have.

good luck.
!