Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Changing Permissions on a Shared Folder

  1. #1
    Join Date
    Jul 2006
    Beans
    486

    Changing Permissions on a Shared Folder

    Hi All,
    I've tried to make this as precise as possible, without getting long-winded, but also wanted to give as much detail as possible. I've been using Ubuntu off and on for several years, so I am not new to it, but I also know that I still have a lot to learn about it.



    Objective:
    I have a folder shared from my Ubuntu box with full open access, CHMOD -777, that I can access from all my Windows boxes, but cannot access from my 2nd Ubuntu box. I want to change the level of access to this folder so that ONLY my own user account can access it, but I want to be able to do it from any Windows or Ubuntu machine on my network.

    Current Setup:
    Currently I have 2 Ubuntu 12.04 boxes, both running SAMBA, on my home network. I also have about 6 different Windows boxes.
    I have ran a CHMOD -777 on the share folder on my first Ubuntu box, and I can access it fine from my Windows boxes, but not from my 2nd Ubuntu box. As stated, I want to change this and only let MY user account FULL access to this network share, hosted on the Ubuntu box.
    One thing I tried is right-clicking on the shared folder and removing the checkbox from the "Guests access (those without a user account)"
    but this eliminates my ability to access the folder, even with my own account. I've tried entering my username and password, and also entering the IP to the host box in front of my username (192.168.x.x\username) but none of these allow me access.

    Current problems I've noticed:
    From my 2nd Ubuntu box, the share on the main Ubuntu box is read-only. I can see it, but cannot make any changes.
    In the GUI on my main Ubuntu box, when I right-click on the shared folder, go to properties, choose the Share tab, and remove the checkbox for "Guest Access (for people without a user account)" it changes the entire folder to read-only, even when I am entering my account credentials.

    Change I want to make:
    1. I want to remove the "guest login OK" from the smb.conf file (easy to do) and remove the checkbox from the permissions on the shared folder, and I want to require that my user account be used each time this share is accessed.
    2. I want to be able to share this folder from my main Ubuntu box to my 2nd Ubuntu box.
    Last edited by kc5hwb; April 9th, 2013 at 01:05 AM. Reason: Solved

  2. #2
    Join Date
    Dec 2009
    Beans
    5,826

    Re: Changing Permissions on a Shared Folder

    Post the output of the following commands so we can all see how your shares are set up:
    Code:
    testparm -s
    Code:
    net usershare info --long

  3. #3
    Join Date
    Jul 2006
    Beans
    486

    Re: Changing Permissions on a Shared Folder

    Code:
    jape@JOSEPHUS:~$ testparm -s
    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$]"
    Processing section "[share]"
    Global parameter usershare owner only found in service section!
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
            workgroup = JUDEA
            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
            usershare owner only = No
            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
    
    [share]
            comment = Tonido Raid
            path = /home/jape/Raid
            read only = No
            create mask = 0777
            guest ok = Yes

    Code:
    jape@JOSEPHUS:~$ net usershare info --long
    [TonidoCloud]
    path=/home/jape/Raid
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y
    
    [Josephus]
    path=/home/jape/Public
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y

  4. #4
    Join Date
    Dec 2009
    Beans
    5,826

    Re: Changing Permissions on a Shared Folder

    There are 2 ways to create a samba share and you are using both on the same folder even though they have different share names:
    This is a Samba Usershare:
    [TonidoCloud]
    path=/home/jape/Raid
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y
    If you want access only to you I would go back into Nautilus and unshare it.

    This is a Samba Classic share:
    [share]
    comment = Tonido Raid
    path = /home/jape/Raid
    read only = No
    create mask = 0777
    guest ok = Yes
    If you want to deny access to anyone but you remove the "guest ok = yes" and replace it with a "valid users = jape" if jape is your user name:
    [share]
    comment = Tonido Raid
    path = /home/jape/Raid
    read only = No
    create mask = 0777
    valid users = jape
    Then restart samba:
    Code:
    sudo service smbd restart
    EDIT: I'm assuming you added yourself to the samba password database:
    Code:
     sudo smbpasswd -a jape

  5. #5
    Join Date
    Jul 2006
    Beans
    486

    Re: Changing Permissions on a Shared Folder

    That top code I posted is the smb.conf file, I recognize that. But how am I using both? Maybe I setup something twice? Should I remove one of them?

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

    Re: Changing Permissions on a Shared Folder

    This samba share ( called a Samba usershare ) was created from Nautilus > Sharing Options:
    Code:
    [TonidoCloud]
    path=/home/jape/Raid
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y
    Remove it by going back into Nautilus and reversing the steps you used to create it.

  7. #7
    Join Date
    Jul 2006
    Beans
    486

    Re: Changing Permissions on a Shared Folder

    So, in other words, just remove the check-marks from Sharing Options in the Nautilus Window.... ?

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

    Re: Changing Permissions on a Shared Folder

    Yes. Then run the following command again and make sure the only output is for your "Public" share - [Josephus]:
    Code:
    net usershare info --long

  9. #9
    Join Date
    Jul 2006
    Beans
    486

    Re: Changing Permissions on a Shared Folder

    http://www.google.com/url?sa=i&rct=j...65031546966248

    Getting this error after performing the steps above. I am logged into the Ubuntu machine locally, but have killed all other remote sessions.

    Additionally, this command now returns nothing at all

    Code:
    net usershare info --long

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

    Re: Changing Permissions on a Shared Folder

    You did not get the following error by removing all of your samba usershares:
    Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again
    You did something else on your Windows machine to induce that error.

Page 1 of 2 12 LastLast

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
  •