Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: samba sharing

  1. #1
    Join Date
    Mar 2013
    Beans
    31

    Question samba sharing

    I have an ubuntu workstation running 13.04 as a server. I have one large LVM-volume spanning over four drives that contains a lot of data.
    I mount this into my home folder of the user that the server is running under. I also share this as samba since most of my other computers are running windows. I have no problem accessing this data from another computer which is running the same username and password as the user on the ubuntu machine. we can call this user userA. I also have a second user, userB which wants to access these files as well. running from the same machines. The rights on the folder and subfolders are drwxrwsr-x and the group name is group1, both userA and userB are part of group1.

    In the sharing options I tried setting both "allow others to create and delete files in this folder" and "guest access", and it doesn't seem to matter. I just can access the share from userB

    I have some subfolders in the shared folder that should not be accessable to userB, therefor I have drwx------ (owner userA) on these folders.

    What should I do. I'm not fluent in linux.

  2. #2
    dino99's Avatar
    dino99 is offline Ubuntu addict and loving it
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

  3. #3
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    7,909

    Re: samba sharing

    Howdy,

    The best way to debug Samba is with a program called 'smbclient'. Read the man page. The advantage is that it will give error messages, so then you can see exactly what is going on. Start by testing things out on the server machine. If it doesn't work right on the server, then it isn't going to work anywhere else either.

  4. #4
    Join Date
    Mar 2013
    Beans
    31

    Re: samba sharing

    Quote Originally Posted by dino99 View Post
    I'm sorry, I got "proxy error" on the first two so I just reloaded the page not wanting to lose the text I written.

  5. #5
    Join Date
    Mar 2013
    Beans
    31

    Re: samba sharing

    Quote Originally Posted by HermanAB View Post
    Howdy,

    The best way to debug Samba is with a program called 'smbclient'. Read the man page. The advantage is that it will give error messages, so then you can see exactly what is going on. Start by testing things out on the server machine. If it doesn't work right on the server, then it isn't going to work anywhere else either.
    Thank you for the tip, I'm trying out some basic things, but I'm clearly not savvy enough to deal with this. I'm getting no errors when I try;
    Code:
    smbclient -U userB -L \\192.168.242.13 -D thefolder

  6. #6
    Join Date
    Dec 2009
    Beans
    5,362

    Re: samba sharing

    In the sharing options I tried setting both "allow others to create and delete files in this folder" and "guest access", and it doesn't seem to matter. I just can access the share from userB
    That's a Samba Usershare. Please post the output of this command so we can see how it's set up:
    Code:
    net usershare info --long
    Just to make sure there is no conflict with this and a Classic Samba share you might have created you might want to post the output of this one as well:
    Code:
    testparm -s

  7. #7
    Join Date
    Mar 2013
    Beans
    31

    Re: samba sharing

    This is what net usershare info --long outputs

    Code:
    [Downloads]
    path=/home/creepwood/Downloads
    comment=
    usershare_acl=Everyone:R,Unix User\creepwood:F,
    guest_ok=n
    
    [home]
    path=/home/creepwood
    comment=
    usershare_acl=Everyone:R,BABEL\creepwood:F,
    guest_ok=n
    
    [media]
    path=/home/creepwood/media
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y
    
    [test]
    path=/home/creepwood/test
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y

    and for testpar -s

    Code:
    Load smb config files from /etc/samba/smb.conf
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[printers]"
    Processing section "[print$]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
            workgroup = MSHOME
            server string = %h server (Samba, Ubuntu)
            map to guest = Bad User
            obey pam restrictions = Yes
            pam password change = Yes
            passwd program = /usr/bin/passwd %u
            passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
            unix password sync = Yes
            syslog = 0
            log file = /var/log/samba/log.%m
            max log size = 1000
            dns proxy = No
            usershare allow guests = Yes
            panic action = /usr/share/samba/panic-action %d
            idmap config * : backend = tdb
    
    [printers]
            comment = All Printers
            path = /var/spool/samba
            create mask = 0700
            printable = Yes
            print ok = Yes
            browseable = No
    
    [print$]
            comment = Printer Drivers
            path = /var/lib/samba/printers

  8. #8
    Join Date
    Dec 2009
    Beans
    5,362

    Re: samba sharing

    Methinks this is all Linux permissions issues rather than a Samba issue and how and where you are accessing each share.

    You have to different types of shares:

    This one allows only credentialed users to gain access to read and only creepwood to write:
    [Downloads]
    path=/home/creepwood/Downloads
    comment=
    usershare_acl=Everyone:R,Unix User\creepwood:F,
    guest_ok=n
    This one allows anyone to read and write:
    [media]
    path=/home/creepwood/media
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y
    So the things to check out are:

    ** Did you encrypt your home directory? If you did then only creepwood is gaining access and UserB or anyone else is out of luck.

    ** Assuming you did not encrypt did you add UserB to the samba password database so he can access the [Downloads] share:
    Code:
    sudo smbpasswd -a UserB
    ** Assumming no one can access the [media] share look at the permissions along the entire path to the target folder to see if anything is getting in the way of a guest user:
    ls -dl /home/creepwood
    ls -dl /home/creepwood/media

  9. #9
    Join Date
    Mar 2013
    Beans
    31

    Re: samba sharing

    the folders are not encrypted. the download folder is only for the creepwood user so that's not a problem. it's the media folder that should be accessible to userB I know the rights on the media folder are too generous right now, I want I want full rights for the owners in media, I want full rights for people in group1 in media and I want others to only be able to read and access folders.


    ls -ld /home/creepwood

    drwxr-xr-x 41 creepwood creepwood 4096 May 23 18:27 /home/creepwood



    ls -ld /home/creepwood/media

    drwxrwxrwx 15 creepwood media 4096 May 3 00:17 /home/creepwood/media

  10. #10
    Join Date
    Dec 2009
    Beans
    5,362

    Re: samba sharing

    How is UserB trying to access the contents of /home/creepwood/media?

    If he is trying to do that through the [home] share he needs a samba password to do that. And even when he has one he will only be allowed to read.

    If he is trying to do that through the [media] share there should be nothing stopping him or any one else from doing so.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •