Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 21
Frustration with this issue is mounting and I'm fairly new when it comes to Samba and Ubuntu in general but I have 2 users setup on my Ubuntu box, user1 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! Muhnamana's Avatar
    Join Date
    Mar 2012
    Location
    Here not there
    Posts
    17

    Samba Share Issues


    Frustration with this issue is mounting and I'm fairly new when it comes to Samba and Ubuntu in general but I have 2 users setup on my Ubuntu box, user1 and user2. These same two users are added within Samba as well.

    user1 is currently logged in on the machine and has an external hdd mounted.

    I have a current share setup within Samba as the following:

    [music]
    comment = Music
    browseable = yes
    path = /media/MyPassport2/Music
    read only = no
    public = yes
    guest = yes
    create mask = 0777
    directory mask = 0777

    When connecting to this share from Windows 7, user1 can connect fine. user2 cannot access this share.

    Does this have something to do with user1 having the drive mounted? Permissions issue possibly? Permissions issues on the Linux level and not Samba?

    Any and all suggestions are welcome. As I said, I'm pretty much stuck.

    Thanks!

  2. #2
    Linux Newbie amithad's Avatar
    Join Date
    Sep 2006
    Location
    Sri Lanka
    Posts
    160

    Smile

    Quote Originally Posted by Muhnamana View Post
    Frustration with this issue is mounting and I'm fairly new when it comes to Samba and Ubuntu in general but I have 2 users setup on my Ubuntu box, user1 and user2. These same two users are added within Samba as well.

    user1 is currently logged in on the machine and has an external hdd mounted.

    I have a current share setup within Samba as the following:

    [music]
    comment = Music
    browseable = yes
    path = /media/MyPassport2/Music
    read only = no
    public = yes
    guest = yes
    create mask = 0777
    directory mask = 0777

    When connecting to this share from Windows 7, user1 can connect fine. user2 cannot access this share.

    Does this have something to do with user1 having the drive mounted? Permissions issue possibly? Permissions issues on the Linux level and not Samba?

    Any and all suggestions are welcome. As I said, I'm pretty much stuck.

    Thanks!
    Haven't you try Webmin GUI. A web based configuration tool for Linux

    Webmin

    From Webmin you can configure Samba

  3. #3
    Just Joined!
    Join Date
    Mar 2008
    Posts
    20
    Hi Muhnamana,

    Can you please give us the mod and ownership of the music share (and its parents)?
    Code:
    ls -ld /{,media/{,MyPassport2/{,Music}}}
    Bye
    Santiago

  4. #4
    Just Joined! Muhnamana's Avatar
    Join Date
    Mar 2012
    Location
    Here not there
    Posts
    17
    Quote Originally Posted by chebarbudo View Post
    Hi Muhnamana,

    Can you please give us the mod and ownership of the music share (and its parents)?
    Code:
    ls -ld /{,media/{,MyPassport2/{,Music}}}
    Bye
    Santiago
    Here you go.

    drwxr-xr-x 23 root root 4096 2012-02-26 10:46 /
    drwxr-xr-x 4 root root 4096 2012-03-03 21:57 /media/
    drwx------ 1 administrator administrator 12288 2012-03-03 23:12 /media/MyPassport2/
    drwx------ 1 administrator administrator 4096 2012-02-05 12:19 /media/MyPassport2/Music

    I'm guessing its a permission issue but not sure how to add user2.

  5. #5
    Just Joined!
    Join Date
    Mar 2008
    Posts
    20
    What puzzles me is that I don't see how user1 can acces the share given the permissions?!?

    My idea of a solution is:

    1. Create a group music-share
    Code:
    groupadd music-share
    2. Change the group owner of the Music share (and its descendants)
    Code:
    chgrp -R music-share /media/MyPassport2/Music
    3. Allow anyone to cd to the share (they won't be able to read anything)
    Code:
    chmod o+x /media/MyPassport2/
    4. Allow the group to read and write the Music share
    Code:
    find /media/MyPassport2/Music/ -type d -exec chmod u=rwx-s,g=rwxs,o= "{}" +
    find /media/MyPassport2/Music/ -type f -exec chmod u=rw-s,g=rw-s,o= "{}" +
    5. Add a user to the group:
    Code:
    usermod -aG music-share user2

  6. #6
    Just Joined! Muhnamana's Avatar
    Join Date
    Mar 2012
    Location
    Here not there
    Posts
    17
    Quote Originally Posted by chebarbudo View Post
    What puzzles me is that I don't see how user1 can acces the share given the permissions?!?

    My idea of a solution is:

    1. Create a group music-share
    Code:
    groupadd music-share
    The only guess, is that the user1 (administrator) was logged onto the machine, which enabled user1 to also access this share via Windows 7. Just a guess but I'm still new to this so I could be wrong.

    But I'll take your suggestions and apply this tonight when I get home from work. I'll let you know the results. I appreciate your assistance.

    2. Change the group owner of the Music share (and its descendants)
    Code:
    chgrp -R music-share /media/MyPassport2/Music
    3. Allow anyone to cd to the share (they won't be able to read anything)
    Code:
    chmod o+x /media/MyPassport2/
    4. Allow the group to read and write the Music share
    Code:
    find /media/MyPassport2/Music/ -type d -exec chmod u=rwx-s,g=rwxs,o= "{}" +
    find /media/MyPassport2/Music/ -type f -exec chmod u=rw-s,g=rw-s,o= "{}" +
    5. Add a user to the group:
    Code:
    usermod -aG music-share user2
    The only guess, is that the user1 (administrator) was logged onto the machine, which enabled user1 to also access this share via Windows 7. Just a guess but I'm still new to this so I could be wrong.

    But I'll take your suggestions and apply this tonight when I get home from work. I'll let you know the results. I appreciate the help.

  7. #7
    Just Joined! Muhnamana's Avatar
    Join Date
    Mar 2012
    Location
    Here not there
    Posts
    17
    Quote Originally Posted by chebarbudo View Post
    What puzzles me is that I don't see how user1 can acces the share given the permissions?!?

    My idea of a solution is:

    1. Create a group music-share
    Code:
    groupadd music-share
    2. Change the group owner of the Music share (and its descendants)
    Code:
    chgrp -R music-share /media/MyPassport2/Music
    3. Allow anyone to cd to the share (they won't be able to read anything)
    Code:
    chmod o+x /media/MyPassport2/
    4. Allow the group to read and write the Music share
    Code:
    find /media/MyPassport2/Music/ -type d -exec chmod u=rwx-s,g=rwxs,o= "{}" +
    find /media/MyPassport2/Music/ -type f -exec chmod u=rw-s,g=rw-s,o= "{}" +
    5. Add a user to the group:
    Code:
    usermod -aG music-share user2
    No good. See below for what I tried. I changed up a little of what you suggested, not sure if that was ok.

    1.
    Code:
    groupadd mypassport2
    2.
    Code:
    chgrp -R mypassport2 /media/MyPassport2
    3.
    Code:
    chmod o+x /media/MyPassport2/
    4.
    Code:
    find /media/MyPassport2/ -type d -exec chmod u=rwx-s,g=rwxs,o= "{}" +
    find /media/MyPassport2/ -type f -exec chmod u=rw-s,g=rw-s,o= "{}" +
    5.
    Code:
    usermod -aG mypassport2 user2
    I just dont understand why this wont work. I'm using the mainly for backups, which I'm in need up desperately...hahaha. I dont like leaving all my eggs in one basket.

  8. #8
    Just Joined! Muhnamana's Avatar
    Join Date
    Mar 2012
    Location
    Here not there
    Posts
    17
    Here's the ouput of the first command you suggested. I may have typed that on my other ubuntu box though but this is now the output from the box that has the MyPassport2.

    Code:
    drwxr-xr-x 25 root          root          4096 2012-03-05 19:50 /
    drwxr-xr-x  4 root          root          4096 2012-03-06 20:10 /media/
    drwx------  1 administrator administrator 4096 2012-03-06 20:28 /media/MyPassport2/

  9. #9
    Just Joined! Muhnamana's Avatar
    Join Date
    Mar 2012
    Location
    Here not there
    Posts
    17
    Found an interesting option for the samba config file. If I use
    Code:
    force user = user1
    and log into the share with user2's credentials, I can access the /media/MyPassport2 directory. I comment out this option, user2 now can't connect. Now I'm throughly confused.

  10. #10
    Just Joined!
    Join Date
    Mar 2008
    Posts
    20
    Hi Muhnamana,

    Did you get any error when typing the commands groupadd, chgrp and chmod.
    Because obviously, given the output of ls, no change was made at all.

    force user is an dangerous option.
    It means that any user will be able to access the share because it will be identified as user1.

    Regards
    Santiago

Page 1 of 3 1 2 3 LastLast

Posting Permissions

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