Samba not quite right in Ubuntu 10.04

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
//myNASserver/userstew /media/userstew smbfs username=myusername,password=password
//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:

The folder contents could not be displayed.
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:

[linkmusic]
	comment = Music for everyone
	writeable = yes
	invalid users = mail,daemon
	create mode = 777
	path = /mnt/disk1/linkmusic
	directory mode = 777

[userstew]
	comment = Stews user area
	writeable = yes
	invalid users = mail,daemon
	create mode = 770
	path = /mnt/disk1/userstew
	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
5 answers Last reply
More about samba ubuntu
  1. 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.
  2. I also believe that to be the issue as well.

    I didn't take much time to look through it, but this thread looks pretty good:
    http://ubuntuforums.org/showthread.php?t=644299

    If it's not, sorry. Good luck :)
  3. 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?
  4. 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
  5. 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.
Ask a new question

Read More

NAS / RAID Ubuntu