FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Jun 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Samba problem!!!! Help!!!!

    Hi,

    I have Fedora 5 on my Dell D865GLC computer, in which I mounted a FAT32 hard drive (2 partitions) in /mnt/movies and /mnt/musics. Here is ls -l /mnt:

    total 16
    drwxrwxr-x 10 root power 4096 Dec 31 1969 movies
    drwxrwxr-x 21 root power 4096 Dec 31 1969 musics
    drwxrwxrwx 4 user power 4096 Jun 29 23:58 share


    that means user (in group power) can read, write, execute, create file/folder in /mnt/movies and /mnt/musics in Linux box.

    I start Samba to share these two mount points so that my XP Pro box can read and write in them. In My Network Places in XP Pro box, I can see these in my server: (\\server)

    user
    movies
    musics

    Of course, in user directory, I (user) can read, write, creat etc... anything. But the problem is I can not access movies and musics. No read, no browseable at all. Here is my share in smb.conf:

    [movies]
    path = /mnt/movies
    writeable = yes
    browesable = yes
    valid users = user
    creat mask = 0002

    [musics]
    path = /mnt/musics
    writeable = yes
    browseable = yes
    creat mask = 0002
    valid users = user

    I think I have no problem of connection or sharing because I can do anythign in user folder. But the prolem happens with these FAT32 mounted partitions. I try to see log files and here it is:

    [2006/06/30 10:48:21, 1] smbd/service.c:make_connection_snum(693)
    fs760w (192.168.0.3) connect to service cuongkn initially as user user (uid=500, gid=500) (pid 17208)
    [2006/06/30 10:48:23, 0] smbd/service.c:make_connection_snum(663)
    '/mnt/musics' does not exist or permission denied when connecting to [musics] Error was Permission denied
    [2006/06/30 10:48:24, 0] smbd/service.c:make_connection_snum(663)
    '/mnt/musics' does not exist or permission denied when connecting to [musics] Error was Permission denied
    [2006/06/30 10:48:24, 0] smbd/service.c:make_connection_snum(663)
    '/mnt/musics' does not exist or permission denied when connecting to [musics] Error was Permission denied

    It seems that it permits me connect to user folder as user, but does not permit me to connect to movies or musics (as user???). I do not know why!!!

    So please help!

    Sorry for long explaination. I want it to be clear.

    KC.

  2. #2
    Join Date
    May 2005
    Location
    NC
    Age
    71
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you created the Samba user "user"? If not, do this:

    smbpasswd -a user

    Respond to password prompts with same password as the Linux "user" account. This must be the same user account and password you use to connect to the share from your XP box. This should take care of connecting to and browsing the share.

    If user account "user" has primary or secondary group of "power" it should have permissions to read/write in the /mnt/movies and /mnt/musics directories, but not necessarily in the shares "movies" and/or "musics".

    Since the directories are "group owned" by "power" group of which "user" is a member, why not setup the shares for this group instead of individual user accounts? Then you can just add user accounts to the "power" share later to give them read/write access the shares. If you just want give them read access, add a line like the following to each share (after you have created their Samba accounts.

    read list = newuser1 newuser2

    Here's how I'd set it up in /etc/samba/smb.conf, based on the info you provided so far:

    movies]
    comment = KC's Favorite Movies
    path = /mnt/movies
    valid users = @power
    write list = @power
    writeable = yes
    browesable = yes
    creat mask = 0774

    [musics]
    comment = KC's Favorite Music
    path = /mnt/musics
    valid users = @power
    write list = @power
    writeable = yes
    browseable = yes
    creat mask = 0774
    write list = @power
    valid users = @power

    Then type the following command to restart Samba:

    service smb restart

    If you're still having problems we might need to change some of your other settings in /etc/samba/smb.conf.

    I'm assuming you are on a private, home network where this machine is not connected directly to the Internet. I'm also assuming that your FAT32 filesystems are mounted read-write (/etc/fstab).
    ./Cal

  3. #3
    Join Date
    Jun 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi cwebster,

    Thanks for your reply. I did creat user before, and its password as well. Otherwise, I can not access user directory in \\server to read, write etc. That means no problem of sharing connection at all. I also edited /etc/fstab to have FAT32 partitions mounted auto at boot, readable, writeable by user user, and here it is:

    LABEL=/ / ext3 defaults 1 1
    devpts /dev/pts devpts gid=5,mode=620 0 0
    tmpfs /dev/shm tmpfs defaults 0 0
    LABEL=/home /home ext3 defaults 1 2
    proc /proc proc defaults 0 0
    sysfs /sys sysfs defaults 0 0
    LABEL=SWAP-sda2 swap swap defaults 0 0
    /dev/hdd1 /mnt/movies vfat auto,uid=500,gid=500,umask=0000,utf8 0 0
    /dev/hdd2 /mnt/musics vfat auto,uid=500,gid=500,umask=0000,utf8 0 0

    Account user can do anything in these FAT32 mounted (in Linux box). The only problem is he can not do anything in these shares, even read or browse. I do not know why.

    I might try to give rw permission to group power as you suggested. That better . But now the problem still remains: can not access to these shares.

    My computer connect to internet through a router (wired). Other by wireless. I am not sure I understand your assumption in the end of your post. You meant a security problem???

    Indeed, I just decided to install Fedora 5 in my desktop and I am totally newbie about linux. So please help me. Thanks.

    KC.

  4. #4
    Join Date
    May 2005
    Location
    NC
    Age
    71
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I probably assumed too much. I'll need some more information. I'll pose a question then, if needed, I'll follow with one or more commands to run in the "root" account that will answer the question. To get into the "root" account type "su -" then respond to the prompt with the password you gave when prompted during installation. Please reply with the response you get from the system when running the commands. Type the commands exactly as shown. Watch out for lower case "L" looking line a numeral one. You should be able to just copy them out of this message and paste them into a terminal window.

    Is there any reason why you want to keep the vfat file systems on "/dev/hdd" as "vfat" type?

    "ext3" is much more efficient and resilient. I'd recommend copying your multimedia files to your main drive. If you need the space on the old drive, you can re-partition it and make it into an "ext3" file system, then copy the files back.

    How much disk space is available on your desktop machine?

    Code:
    fdisk -l
    df -k


    What does user account "user" look like in /etc/passwd /etc/samba/group and /etc/group?

    Code:
    grep user /etc/passwd /etc/group /etc/samba/smbpasswd
    
    "smbpasswd" should look something like this:
    user:500:5AEDA360059F1DBE784EB7C9BE172089:5640AA3EBBD4B72BB1B947C1AFA60ABF:[U          ]:LCT-44A4410B:
    Please change several of the letters and numbers before you post so you're not giving away anything.



    what are real ownership and permissions of files in /mnt/musics and /mnt/movies?

    Code:
    ls -l /mnt/musics | head -5
    ls -l /mnt/movies | head -5


    You probably don't need all those mount options for the /dev/hdd partitions. If you have some reason to keep them "vfat", you should be able to just use the following line in your /etc/fstab.

    Code:
    /dev/hdd1 /mnt/movies vfat defaults 0 0
    /dev/hdd2 /mnt/musics vfat defaults 0 0


    You can change the ownership and permissions of all the files as root like this, once they're mounted.

    Code:
    cd /mnt
    chown -R user:power movies music
    chmod -R 755 movies music


    I've got to run some errands but I'll check back later tonight and try to get you going.
    Last edited by cwebster; 29th June 2006 at 11:12 PM.
    ./Cal

  5. #5
    Join Date
    Jun 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Cal,

    I have two hard drives in Linux box, one in ext (120G) and one in fat32 (122G) which has a lot of musics, movies and documents in. Here it goes:

    Code:
    [root@d865glc ~]# fdisk -l
    
    Disk /dev/hdd: 122.9 GB, 122942324736 bytes
    255 heads, 63 sectors/track, 14946 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdd1   *           1        7649    61440561    c  W95 FAT32 (LBA)
    /dev/hdd2            7650       14946    58613152+   c  W95 FAT32 (LBA)
    
    Disk /dev/sda: 120.0 GB, 120034123776 bytes
    255 heads, 63 sectors/track, 14593 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1        2550    20482843+  83  Linux
    /dev/sda2            2551        2681     1052257+  82  Linux swap / Solaris
    /dev/sda3            2682       14593    95683140   83  Linux
    Code:
    [root@d865glc ~]# df -l
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sda1             19840892   6344728  12472024  34% /
    tmpfs                   507932         0    507932   0% /dev/shm
    /dev/sda3             92685620    560176  87341288   1% /home
    /dev/hdd1             61320772  35951040  25369732  59% /mnt/movies
    /dev/hdd2             58498880  17428068  41070812  30% /mnt/musics
    Code:
    [root@d865glc ~]# grep user /etc/passwd /etc/group /etc/samba/smbpasswd
    /etc/passwd:user:x:500:500:Cuong Kieu Nguyen:/home/user:/bin/bash
    /etc/group:power:x:500:user
    /etc/samba/smbpasswd:user:500:7F5227FABDB812308915C611551A63D8:F5DDE2FCC128FAF9B5F4CEEFFEF1412F:[U          ]:LCT-44A3483C:
    Code:
    [root@d865glc ~]# ls -l /mnt/musics | head -5
    total 23796
    drwxrwxrwx  2 user power     4096 Apr  3 20:55 Archive
    drwxrwxrwx  2 user power     4096 Mar 31 17:39 Bonus - AcousticMoods
    drwxrwxrwx  2 user power     4096 Apr 22 10:42 LamTruong
    drwxrwxrwx  4user power     4096 May 17 11:46 Casablanca
    ....
    Code:
    [root@d865glc ~]# ls -l /mnt/movies | head -5
    total 36
    drwxrwxrwx  5 user power 4096 Apr  5 21:06 Docs
    -rwxrwxrwx  1 user power    0 Jun 22 14:14 autoexec.bat
    -rwxrwxrwx  1 user power    0 Jun 22 14:14 config.sys
    drwxrwxrwx 11 user power 4096 Jun 23 07:59 Films
    .............
    There is no exact reason why I want to keep fat32 type. I know I can copy data to another one, format with ext and copy again although it will take time because I have many many data in that drive. But the important thing is I want to learn. I heard about linux can be the best sharing files and web server so I think I should know how to do. It is easier to share files and folders in XP box, right?

    Thanks.

    KC.

  6. #6
    Join Date
    Jul 2005
    Location
    Melbourne, Australia
    Age
    47
    Posts
    762
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Troubleshooting hint - open up several terminal windows as root.

    in one, run "tail -n 30 -f /var/log/secure"
    in another, run "tail -n 30 -f /var/log/messages"
    in another, run "tail -n 30 -f <where the samba log is, I forget>"

    Try to access those shares. See what errors come up in real time!

    I am confused as to your problem as from what you've written, it SHOULD work. Mind you I've had similar issues before where my permissions all look OK, samba user + linux user set up OK, and still I get issues...

    It is easier to set up simple sharing in XP but you don't have anywhere as much control over specifics + large scale its stuffed (I think there's a limit of 10 connections as well etc.). Also u don't get unix permissions (and corresponding problems mwhahaahaha)
    the phases of 'nix troubleshooting

    For :eek:
    :confused: | google > :D
    Next

  7. #7
    Join Date
    Jun 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi johannlo,

    tail -n 30 -f /var/log/secure gives no error. Here are these two other outputs:

    Code:
    [root@d865glc samba]# tail -n 30 -f /var/log/samba/fs760w.log
    
    [2006/06/30 22:53:22, 0] smbd/service.c:make_connection_snum(663)
      '/mnt/musics' does not exist or permission denied when connecting to [musics] Error was Permission denied
    [2006/06/30 22:53:23, 0] smbd/service.c:make_connection_snum(663)
      '/mnt/musics' does not exist or permission denied when connecting to [musics] Error was Permission denied
    [2006/06/30 22:53:23, 0] smbd/service.c:make_connection_snum(663)
      '/mnt/musics' does not exist or permission denied when connecting to [musics] Error was Permission denied
    Code:
    [root@d865glc ~]# tail -n 30 -f /var/log/messages
    
    Jun 30 22:53:22 d865glc smbd[23676]:   '/mnt/musics' does not exist or permission denied when connecting to [musics] Error was Permission denied
    Jun 30 22:53:23 d865glc smbd[23676]: [2006/06/30 22:53:23, 0] smbd/service.c:make_connection_snum(663)
    Jun 30 22:53:23 d865glc smbd[23676]:   '/mnt/musics' does not exist or permission denied when connecting to [musics] Error was Permission denied
    Jun 30 22:53:23 d865glc smbd[23676]: [2006/06/30 22:53:23, 0] smbd/service.c:make_connection_snum(663)
    Jun 30 22:53:23 d865glc smbd[23676]:   '/mnt/musics' does not exist or permission denied when connecting to [musics] Error was Permission denied
    Yes, I also thought it should have work, but the fact is it does not! You concern about your issues recently. So do you still have them now or you solved already? If you solved, so could you let me know how???

    Thanks,

    KC.

  8. #8
    Join Date
    Jul 2005
    Location
    Melbourne, Australia
    Age
    47
    Posts
    762
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try changing the owner of the directories to your user?

    Do you by chance have SELinux running? (shot in the dark)

    My error is specifically: from my media centre (MCE2005) I can't access my linux user's home directory even though the samba user / linux user (for the media center's login) has read permissions. HOWEVER it works if I enable EXECUTE permissions (????), however, his then breaks my SSH access ?!?!. Haven't fixed it as it doesn't bother me - my media is archived in a different directory

    Otherwise, here's what I can come up with

    - Can you connect to those shares when ur logged into the server itself as user?

    smbclient //localhost/<share>. You can test other accounts by adding the -U accountname

    - Maybe SELinux is blocking the access? (if in doubt, turn if off - u don't really need it in a non-enterprise environment presuming ur firewall is setup OK)
    the phases of 'nix troubleshooting

    For :eek:
    :confused: | google > :D
    Next

  9. #9
    Join Date
    Jun 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Johannlo,

    The owner of these directories is user as I quoted above. I tried to allow Samba as trusted service in SELinux, no help . I also tried to disable SELinux (system-config-securitylevel and then disable), still no help! Your solution seems not to work for me because I have 777 for all these directories.

    I tried to connect to those shares as root, but there is some errors:

    Code:
    [root@d865glc ~]# smbclient //localhost/mnt/movies
    Password:
    session setup failed: NT_STATUS_LOGON_FAILURE
    
    [root@d865glc ~]# smbclient //localhost/mnt/movies -U user
    Password:
    Domain=[D865GLC] OS=[Unix] Server=[Samba 3.0.22-1.fc5]
    tree connect failed: NT_STATUS_BAD_NETWORK_NAME
    Any ideas?

    Thanks,

    KC.

  10. #10
    OLD_GOLD Guest
    Maybe your problem is that smb file system support has been removed from FC5 in favor of cifs file system support.

    Check out this thread

    http://www.uwsg.iu.edu/hypermail/lin...05.1/1147.html

  11. #11
    Join Date
    Jun 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,

    I try mount -t cifs as below:

    Code:
    [root@d865glc ~]# mount -t cifs //localhost/dev/hdd1 /mnt/movies --verbose -o user=user
    parsing options: rw,user=user
    Password:
    
    mount.cifs kernel mount options unc=//localhost/dev\hdd1,ip=127.0.0.1,pass=password,ver=1,rw,user=user
    retrying with upper case share name
    
    mount.cifs kernel mount options unc=//LOCALHOST/DEV\HDD1,ip=127.0.0.1,pass=password,ver=1,rw,user=user
    mount error 6 = No such device or address
    Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
    here, /dev/hdd1 is one partition in my fat32 drive. But it has the above error. Do I use the right command of mount with cifs or not? Anybody knows, tell me please!

    Thanks,

    KC.

  12. #12
    Join Date
    May 2005
    Location
    NC
    Age
    71
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, removing smbfs support was a surprise to me. It's possible this could contribute, but I don't think it is in this case. In the bug report that OLD_GOLD pointed to they're talking about mounting a Windows (CIFS/SMB) share on a Linux box. We're talking about mounting vfat file systems on a Linux machine and sharing them via Samba.

    The errors are all related to permissions. If you're Windows host name were "winxp_host" this is similar to what you should be seeing in /var/log/samba/winxp_host.log

    Code:
    [2006/06/30 09:49:27, 1] smbd/service.c:make_connection_snum(648)
      winxp_host (192.168.3.29) connect to service Movies initially as user user (uid=500, gid=500) (pid 11150)
    First, ensure SELINUX isn't tripping you up:

    Code:
    setenforce 0
    Next, turn off your Linux firewall:

    Code:
    service iptables stop
    As "johannlo" suggested, ensure the problem is not ownership/permissions on the directories you are trying to share:

    Code:
    chown -R user:user /mnt/musics /mnt/movies
    chmod -R 775 /mnt/musics /mnt/movies
    
    service smb restart
    ## Watch the logs in separate terminal windows:

    Code:
    tail -f /var/log/messages
    tail -f /var/log/samba/winxp_host.log
    
    Note: Replace "winxp_host" with the real host name of your XP machine.
    Try again to connect to "musics" or "movies" share from Windows.

    If you're still having issues, see what happens when you copy your movies into your Linux home directory. Home directories are setup by default in smb.conf. We're spending a lot of time with mounting issues when we probably don't need to. We can rule out any mounting issues by moving one of the directories to one of the Linux partions and sharing it from there. I think KC will be much happier maintaining his/her music and movies on an ext3 file system anyway.

    Code:
    cp -R /mnt/movies /home/user/
    chown -R user:user /home/user
    chmod 775 /home/user/movies
    chmod 664 /home/user/movies/*
    Now you should see the movies show up in your home when you mount it from Windows. You would be mapping "\\d865glc\user" to a drive unless you are browsing in "My Network Places".

    If you don't want to share it out of your home directory copy them to /usr/local:

    Code:
    cp -r /mnt/movies /usr/local/
    chown -R user:power /usr/local/movies
    chmod 775 /usr/local/movies
    chmod 664 /usr/local/movies/*
    Change the path of the share in /etc/samba/smb.conf
    (assuming you're using my example from before)

    Code:
    path = /usr/local/movies
    Restart Samba:

    Code:
    service smb restart
    Then you'd map "\\d865glc\movies" to a drive
    ./Cal

  13. #13
    Join Date
    Jun 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Cal,

    Thanks. After playing on and off with setenforce, iptables, I have found out the temporary how I can connect to my shares. That is just setenforce 0. iptables has no infection on these shares . So the problem is my SELinux. Before, I just knew to disable it by system-config-securitylevel and then disable, and that was no help.

    So anybody can tell me what is SELinux, is it different from Linux firewall? and does anybody know why SELinux affect on my shares? How can I change setting of SELinux so that it will not prevent me from accessing shares anymore?

    Thanks,

    KC.

  14. #14
    Join Date
    May 2005
    Location
    NC
    Age
    71
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can disable SELinux completely or you can set it to run in "Permissive" mode. In Permissive mode it won't actually do anything except log problems and tell you what it would have done.

    To change the default setting edit the file "/etc/sysconfig/selinux" changing the setting to:

    Code:
    SELINUX=permissive
    	or
    SELINUX=disabled

    SELinux is Security Enhanced Linux. It was originally developed by NSA and contributed to open source. Through Linux security modules (LSM) built into the kernel, it uses a mandatory access control (MAC) system to increase the granularity with which system administrators can control what processes can do with a given set of resources. There's much more to it. If you'd like to read about there's more information in the RHEL 4 Reference Guide and on the SELinux web site.

    Red Hat Enterprise Linux Manuals
    SELinux Web Site

    "iptables" is your firewall software. You should turn it back on now if it's not causing any problems. If it does prevent your shares from working you can post to the forum and myself or someone else can help you implement a firewall rule to do what you need to do.

    SELinux basically protects your system from internal threats while iptables protects it from external ones.

    You can also read more about iptables in the reference guide. Since you are new to Linux, take some time and read paragraph 3.1 "Documentation For First-Time Linux Users" too.
    ./Cal

  15. #15
    Join Date
    Jun 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Cal and all,

    Thanks so much for your help! I do not know this can be considered as the solution of mine or not, but to my point of view, it is not be cause disabling SELinux (or let it run in permissive mode) is something like a temporary solution, not a deeply understandable one. I believe there must be something inside SELinux (like port config, samba config, internal firewall - I do not know yet) - something more specific and more persuasive, right?

    Anyway, thanks a lot for your help .

    KC.

Page 1 of 2 12 LastLast

Similar Threads

  1. System-config-samba problem - Samba 3.0.23c-1.fc5
    By Duli in forum Servers & Networking
    Replies: 0
    Last Post: 30th September 2006, 03:37 AM
  2. Yet another samba problem
    By HaMBoNE79 in forum Servers & Networking
    Replies: 2
    Last Post: 8th July 2005, 08:41 PM

Tags for this Thread

Posting Permissions

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