Find the answer to your Linux question:
Results 1 to 4 of 4
I've managed to get a samba server running using CentOS 6.2 and it appears on my network, like it's suppose to. If I log in with the user I've created ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    10

    File permissions for Samba


    I've managed to get a samba server running using CentOS 6.2 and it appears on my network, like it's suppose to. If I log in with the user I've created (call them usr1) it displays the one share I've created for access called "media", like it's suppose to. However whenever I try to change the contents of the file from another computer I get "permission denied", not like it's suppose to.

    The file my samba share points to (/media) was owned by root on the CentOS system which I thought was the problem so I made it owned by usr1. This didn't seem to make any difference what do I need to change so that I can read/write files to the samba share I've created?

    My smb.conf for media is
    Code:
    [media]
    path = /media
    writable = yes
    browsable = yes
    valid users = usr1
    Any help/criticism/non-mockery is greatly and immensely appreciated!

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    i'm not clear on this - did you change the ownership of the directory itself? e.g.:

    Code:
    chown -R usr1 /media
    Last edited by atreyu; 06-05-2012 at 03:56 AM. Reason: -R

  3. #3
    Just Joined!
    Join Date
    Apr 2012
    Posts
    10
    Quote Originally Posted by atreyu View Post
    i'm not clear on this - did you change the ownership of the directory itself? e.g.:

    Code:
    chown -R usr1 /media
    Yep, that's what I tried. Should I have done something different?

    -----------------------------------------------------------------------------------
    UPDATE:
    Managed to ID the problem but can't seem to fix it.

    First tried moving the [media] directory to /home/samba but had the same issue. Disabling SELinux makes everything work fine. Tried modifying directory with:
    Code:
    chcon -Rv --type=user_home_t /home/samba
    but after I re-enabled SELinux I was still denied access

    Any clue what I'm not doing to allow SELinux to grant samba/samba users access to [media]?
    Last edited by code_ape; 06-05-2012 at 03:33 PM. Reason: Update

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by code_ape View Post
    Managed to ID the problem but can't seem to fix it.

    First tried moving the [media] directory to /home/samba but had the same issue. Disabling SELinux makes everything work fine. Tried modifying directory with:
    Code:
    chcon -Rv --type=user_home_t /home/samba
    but after I re-enabled SELinux I was still denied access

    Any clue what I'm not doing to allow SELinux to grant samba/samba users access to [media]?
    have you tried something like this?

    Code:
    semanage fcontext -a -t samba_share_t '/media(/.*)?'
    restorecon -R /media
    see this guide for more info on Samba and SELinux.

Posting Permissions

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