Professional Web Applications Themes

Samba problems - FreeBSD

Hello, I am using FreeBSD 5.3 with Samba 3.0.7,1. I can read all files from a Windows 2000 Pro. But when I try to access a mount point that is an NTFS filesystem, I have no read permission (files and directories appear as zero length files) until I access them from the server machine (like doing an 'ls'). My configuration file is as follows: ===== BEGIN ===== # Samba config file created using SWAT # from 127.0.0.1 (127.0.0.1) # Date: 2004/12/11 19:24:02 # Global parameters [global] workgroup = VARNET server string = FreeBSD 5.3 security = SHARE log file = ...

  1. #1

    Default Samba problems

    Hello,

    I am using FreeBSD 5.3 with Samba 3.0.7,1.

    I can read all files from a Windows 2000 Pro. But when
    I try to access a mount point that is an NTFS filesystem, I have no read
    permission (files and directories appear as zero length files) until I
    access them from the server machine (like doing an 'ls').

    My configuration file is as follows:

    ===== BEGIN =====
    # Samba config file created using SWAT
    # from 127.0.0.1 (127.0.0.1)
    # Date: 2004/12/11 19:24:02

    # Global parameters
    [global]
    workgroup = VARNET
    server string = FreeBSD 5.3
    security = SHARE
    log file = /var/log/samba/log.%m
    max log size = 50
    dns proxy = No

    [mnt]
    comment = Mounted Filesystems
    path = /mnt
    guest ok = Yes

    [printers]
    comment = All Printers
    path = /var/spool/samba
    printable = Yes
    browseable = No

    [ale]
    comment = Ale's Home DIrectory
    path = /home/ale
    guest ok = Yes
    ===== END =======

    Note: I have subdirectories under '/mnt' like 'w2k', 'wxp', 'cam', and
    'tmp'.

    What am I doing wrong?

    Thanks and Best Regards,
    Ale
    Alejandro Guest

  2. #2

    Default Re: Samba problems

    First of all, make sure those mounts are accessible for normal users, if
    you haven't. It's under the options for the mount in /etc/fstab, I
    think. You can always do a 'man fstab' if unsure.

    Does the username/password (check out 'smbpasswd') you are using to
    connect to samba exist in the samba user database? If not, samba won't
    know who you are, and will use the default guest user to access files
    (usually very restricted). That might be why you can access the mounts
    when you log in to the server, but not through server.

    If you go with the first, ALL users will have access. If you want to
    restrict it to, say, a certain group, you have to go with the second
    solution I think (and add users in the samba user database).

    Hope I got the issue correctly, else I dunno :-).

    Regards,
    Stefan Haglund
     
    Stefan Guest

  3. #3

    Default Re: Samba problems

    On Sat, 26 Mar 2005 16:59:11 +0100
    Stefan Haglund <com> wrote: 

    Hello,

    Thank you for your reply.

    I am using the security level "SHARE" with "guest" enabled (I have only
    two machines on my network).

    The mounts are accessible by normal users (like "ale"), the permissions
    in '/mnt/w2k/' are 'rwxr-xr-x', the owner is "root" and group "wheel".

    I would like to add that I also have another share that is a FAT32
    partition (WinXP) and I can browse it from the other machine (like
    everything else).

    I tried to map the guest account to the user "ale" that I use (and I can
    access '/mnt/w2k'), but nothing happened.

    This only happens in a NTFS mount point. The files and directories show
    as truncated, and I can not "see" (determine size, copy, determine
    if it is a file or directory, etc.) them until I do an operation over
    them with any normal user in the server, then I can see the files/dirs
    affected by the operation I did (ls, etc.). Before I only see the
    entries (names) without attributes (permissions, directory flag, etc.).

    Thanks and Best Regards,
    Ale
    Alejandro Guest

  4. #4

    Default Re: Samba problems

    On Sat, 26 Mar 2005 13:54:37 -0300
    Alejandro Pulver <biz> wrote:
     
    >
    > Hello,
    >
    > Thank you for your reply.
    >
    > I am using the security level "SHARE" with "guest" enabled (I have
    > only two machines on my network).
    >
    > The mounts are accessible by normal users (like "ale"), the
    > permissions in '/mnt/w2k/' are 'rwxr-xr-x', the owner is "root" and
    > group "wheel".
    >
    > I would like to add that I also have another share that is a FAT32
    > partition (WinXP) and I can browse it from the other machine (like
    > everything else).
    >
    > I tried to map the guest account to the user "ale" that I use (and I
    > can access '/mnt/w2k'), but nothing happened.
    >
    > This only happens in a NTFS mount point. The files and directories
    > show as truncated, and I can not "see" (determine size, copy,
    > determine if it is a file or directory, etc.) them until I do an
    > operation over them with any normal user in the server, then I can see
    > the files/dirs affected by the operation I did (ls, etc.). Before I
    > only see the entries (names) without attributes (permissions,
    > directory flag, etc.).
    >
    > Thanks and Best Regards,
    > Ale[/ref]

    I even tried mapping the guest account to root but it still does not
    work.

    Thanks and Best Regards,
    Ale
    Alejandro Guest

  5. #5

    Default Re: Samba problems

    Alejandro Pulver <biz> wrote:
     

    Who owns the subdirectories and who is your guest user?

    I'm using samba version 3.0.11 and can't reproduce the described behavior.

    My smb.conf is:

    [global]

    workgroup = W62
    netbios name = TP51
    server string = Samba Server auf Laptop
    security = user
    encrypt passwords = yes
    log file = /var/log/samba/log.%m
    max log size = 50
    socket options = TCP_NODELAY
    wins support = yes
    dns proxy = no

    [fk]
    comment = No place like home
    path = /home/fk
    valid users = fk
    public = no
    writable = yes
    printable = no

    [mnt]
    comment = Quick test
    path = /mnt
    valid users = fk
    public = no
    writable = yes
    printable = no

    fkr51 /mnt $ls -l
    total 8
    drwxr-xr-x 1 fk wheel 0 Apr 22 2009 ad0s1
    drwxr-xr-x 1 fk wheel 4096 Jan 1 1980 ad0s2
    drwxr-xr-x 5 fk wheel 512 Mar 25 19:14 datenspeicher
    drwxr-xr-x 2 fk wheel 512 Mar 26 19:03 test

    ad0s1 is ntfs, ad0s2 is fat32. Both can be used without any problems.

    I just noticed the strange dates. If I unmount ad0s1 and ad0s2,
    the dates make more sense.

    fkr51 /mnt #ls -l
    total 8
    drwxr-xr-x 2 fk wheel 512 Mar 26 18:58 ad0s1
    drwxr-xr-x 2 fk wheel 512 Mar 26 15:03 ad0s2
    drwxr-xr-x 5 fk wheel 512 Mar 25 19:14 datenspeicher
    drwxr-xr-x 2 fk wheel 512 Mar 26 19:03 test

    Interesting. I'm using FreeBSD 5.4-PRERELEASE #2: Fri Mar 25 17:53:21 CET 2005.

    Fabian
    --
    http://www.fabiankeil.de
    Fabian Guest

  6. #6

    Default Re: Samba problems

    Could you output the /etc/fstab? As far as I know, the major difference
    is that writing to NTFS isn't fully supported in Linux (last I checked).
    Maybe there is something Samba tries to do, that conflicts with that.
    Other than that I don't know, sorry. :-)

    Regards,
    Stefan Haglund
     
    >
    >Hello,
    >
    >Thank you for your reply.
    >
    >I am using the security level "SHARE" with "guest" enabled (I have only
    >two machines on my network).
    >
    >The mounts are accessible by normal users (like "ale"), the permissions
    >in '/mnt/w2k/' are 'rwxr-xr-x', the owner is "root" and group "wheel".
    >
    >I would like to add that I also have another share that is a FAT32
    >partition (WinXP) and I can browse it from the other machine (like
    >everything else).
    >
    >I tried to map the guest account to the user "ale" that I use (and I can
    >access '/mnt/w2k'), but nothing happened.
    >
    >This only happens in a NTFS mount point. The files and directories show
    >as truncated, and I can not "see" (determine size, copy, determine
    >if it is a file or directory, etc.) them until I do an operation over
    >them with any normal user in the server, then I can see the files/dirs
    >affected by the operation I did (ls, etc.). Before I only see the
    >entries (names) without attributes (permissions, directory flag, etc.).
    >
    >Thanks and Best Regards,
    >Ale
    >
    >
    >[/ref]
    Stefan Guest

  7. #7

    Default Re: Samba problems

    On Sat, 26 Mar 2005 20:37:51 +0100
    Fabian Keil <de> wrote:
     
    >
    > Who owns the subdirectories and who is your guest user?
    >
    > I'm using samba version 3.0.11 and can't reproduce the described
    > behavior.
    >
    > My smb.conf is:
    >
    > [global]
    >
    > workgroup = W62
    > netbios name = TP51
    > server string = Samba Server auf Laptop
    > security = user
    > encrypt passwords = yes
    > log file = /var/log/samba/log.%m
    > max log size = 50
    > socket options = TCP_NODELAY
    > wins support = yes
    > dns proxy = no
    >
    > [fk]
    > comment = No place like home
    > path = /home/fk
    > valid users = fk
    > public = no
    > writable = yes
    > printable = no
    >
    > [mnt]
    > comment = Quick test
    > path = /mnt
    > valid users = fk
    > public = no
    > writable = yes
    > printable = no
    >
    > fkr51 /mnt $ls -l
    > total 8
    > drwxr-xr-x 1 fk wheel 0 Apr 22 2009 ad0s1
    > drwxr-xr-x 1 fk wheel 4096 Jan 1 1980 ad0s2
    > drwxr-xr-x 5 fk wheel 512 Mar 25 19:14 datenspeicher
    > drwxr-xr-x 2 fk wheel 512 Mar 26 19:03 test
    >
    > ad0s1 is ntfs, ad0s2 is fat32. Both can be used without any problems.
    >
    > I just noticed the strange dates. If I unmount ad0s1 and ad0s2,
    > the dates make more sense.
    >
    > fkr51 /mnt #ls -l
    > total 8
    > drwxr-xr-x 2 fk wheel 512 Mar 26 18:58 ad0s1
    > drwxr-xr-x 2 fk wheel 512 Mar 26 15:03 ad0s2
    > drwxr-xr-x 5 fk wheel 512 Mar 25 19:14 datenspeicher
    > drwxr-xr-x 2 fk wheel 512 Mar 26 19:03 test
    >
    > Interesting. I'm using FreeBSD 5.4-PRERELEASE #2: Fri Mar 25 17:53:21
    > CET 2005.
    >
    > Fabian
    > --
    > http://www.fabiankeil.de[/ref]

    Hello,

    Thank you for your reply.

    My guest user is 'nobody', but I also tried with 'ale' and 'root' (wich
    owns the mount point).

    The directory '/mnt/w2k' is owned by 'root' and the group 'wheel', the
    permissions are rwxr-xr-x.

    Y have the same strange dates.

    Thanks and Best Regards,
    Ale
    Alejandro Guest

  8. #8

    Default Re: Samba problems

    Alejandro Pulver <biz> wrote:
     
    > >
    > > Who owns the subdirectories and who is your guest user?[/ref][/ref]
     

    Did you see in samba's log that the guest user was changed?
    How did you change it, with "guest user" or with "force user"?

    As your problem can be reproduced, increasing samba's debug
    level might help. Samba should log why read access was denied.

    If you access the samba share with mount_smbfs, do you see
    the same behavior?
     

    If you only want read access, this looks fine.

    Fabian
    --
    http://www.fabiankeil.de
    Fabian Guest

  9. #9

    Default Re: Samba problems

    On Sun, 27 Mar 2005 11:02:44 +0200
    Fabian Keil <de> wrote:
     [/ref]

    >
    > Did you see in samba's log that the guest user was changed?
    > How did you change it, with "guest user" or with "force user"?
    >
    > As your problem can be reproduced, increasing samba's debug
    > level might help. Samba should log why read access was denied.
    >
    > If you access the samba share with mount_smbfs, do you see
    > the same behavior?

    >
    > If you only want read access, this looks fine.
    >
    > Fabian
    > --
    > http://www.fabiankeil.de
    >[/ref]

    Hello,

    Thank you for your reply.

    I saw in SWAT that the connection from the other machine was mapped to
    the desired local user in all cases (I tried "nobody", "ale" and
    "root"). I used "guest account = <user>".

    Something strange is happening: I can access the sahre '/mnt' (and
    'w2k') with 'smbclient' (using the 'guest' user), but if I do it with
    'mount_smbfs //guestale/mnt /home/ale/tmp' then the problem appears,
    even with 'root' (I can not see/access entries until I list them with
    any user from '/mnt/w2k').

    I think the problem is with Samba, not 'mount_smbfs'.

    This message appears (many times) in debug level 0:

    [2005/03/27 15:04:38, 1] smbd/service.c:make_connection_snum(648)
    mariana (192.168.1.1) connect to service mnt initially as user nobody
    (uid=65534, gid=65534) (pid 1217)[2005/03/27 15:04:44, 0]
    locking/posix.c:posix_fcntl_lock(657) posix_fcntl_lock: WARNING: lock
    request at offset 0, length 4096 returned[2005/03/27 15:04:44, 0]
    locking/posix.c:posix_fcntl_lock(658) an Invalid argument error. This
    can happen when using 64 bit lock offsets[2005/03/27 15:04:44, 0]
    locking/posix.c:posix_fcntl_lock(659) on 32 bit NFS mounted file
    systems.

    The other message I noticed (but I think it is not an error) in level 3
    is:

    [2005/03/27 14:16:19, 2] auth/auth.c:check_ntlm_password(312)
    check_ntlm_password: Authentication for user [nobody] -> [nobody]
    FAILED with error NT_STATUS_WRONG_PASSWORD[2005/03/27 14:16:19, 3]
    auth/auth.c:check_ntlm_password(219) check_ntlm_password: Checking
    password for unmapped user [VARNET]\[nobody][mariana] with the new
    password interface[2005/03/27 14:16:19, 3]
    auth/auth.c:check_ntlm_password(222) check_ntlm_password: mapped user
    is: [ALE]\[nobody][mariana]

    The one that also called my attention was:

    [2005/03/27 14:16:30, 3] smbd/error.c:error_packet(105)
    error string = Is a directory
    [2005/03/27 14:16:30, 3] smbd/error.c:error_packet(129)
    error packet at smbd/nttrans.c(862) cmd=162 (SMBntcreateX)
    NT_STATUS_FILE_IS_A_DIRECTORY

    However I do not know about the internal working of Samba so perhaps I
    missed some important messages.

    I made different logs with different debug levels. They are in
    ftp://ftp.varnet.to (public FTP) in a directory called "samba_logs". The
    local machine is called "ale" and the other "mariana". The best log in
    level 3 is in the directory "log.3_2".

    Thanks and Best Regards,
    Ale
    Alejandro Guest

  10. #10

    Default Re: Samba problems

    Alejandro Pulver <biz> wrote:
     
    > > 
    > >
    > > Did you see in samba's log that the guest user was changed?
    > > How did you change it, with "guest user" or with "force user"?
    > >
    > > As your problem can be reproduced, increasing samba's debug
    > > level might help. Samba should log why read access was denied.
    > >
    > > If you access the samba share with mount_smbfs, do you see
    > > the same behavior?
    > > [/ref][/ref]
     

    Today I tried your smb.conf and it worked as well as mine.

    I had a look at you logs, but didn't get more information out
    of them than you did. I get lock offset warnings as well,
    so they don't seem to be the problem.

    Perhaps you should ask on a samba list again.

    Fabian
    --
    http://www.fabiankeil.de
    Fabian Guest

  11. #11

    Default Re: Samba problems

    On Mon, 28 Mar 2005 15:17:57 +0200
    Fabian Keil <de> wrote:
     [/ref]

    >
    > Today I tried your smb.conf and it worked as well as mine.
    >
    > I had a look at you logs, but didn't get more information out
    > of them than you did. I get lock offset warnings as well,
    > so they don't seem to be the problem.
    >
    > Perhaps you should ask on a samba list again.
    >
    > Fabian
    > --
    > http://www.fabiankeil.de
    >[/ref]

    Hello,

    Thank you for your time.

    I will wait until the release of FreeBSD 5.4 and then I will try again
    with the new version of Samba.

    Thanks (again) and Best Regards,
    Ale
    Alejandro Guest

  12. #12

    Default Re: Samba problems

    At 12:29 PM -0300 3/26/05, Alejandro Pulver wrote: 

    Let me see if I understand the situation:

    You have a FreeBSD box running Samba. You have Win2k boxes
    which connect to file shares on that FreeBSD box. When they
    do, the PC's can not access partitions on the FreeBSD box,
    unless the FreeBSD box has already accessed them.

    I don't quite understand the reference to NTFS. Are you saying
    that the *FreeBSD* box is mounting NTFS partitions, and it then
    makes those partitions available to the PC's via Samba? Where
    are those NTFS partitions located? Are they on the hard drives
    of the FreeBSD box? Or is the FreeBSD box mounting them from
    some other file server?
     

    What *exactly* is your /etc/fstab file? The fact that you
    have directories under /mnt does not tell us anything about
    what filesystems you are mounting, or how they are getting
    mounted.

    --
    Garance Alistair Drosehn = netel.rpi.edu
    Senior Systems Programmer or org
    Rensselaer Polytechnic Institute or edu
    Garance Guest

  13. #13

    Default Re: Samba problems

    On Tue, 29 Mar 2005 11:52:15 -0500
    Garance A Drosihn <edu> wrote:
     
    >
    > Let me see if I understand the situation:
    >
    > You have a FreeBSD box running Samba. You have Win2k boxes
    > which connect to file shares on that FreeBSD box. When they
    > do, the PC's can not access partitions on the FreeBSD box,
    > unless the FreeBSD box has already accessed them.
    >[/ref]

    Yes.
     

    The NTFS slice I mount at '/mnt/w2k' is in the server. I only have two
    machines.
     
    >
    > What *exactly* is your /etc/fstab file? The fact that you
    > have directories under /mnt does not tell us anything about
    > what filesystems you are mounting, or how they are getting
    > mounted.
    >
    > --
    > Garance Alistair Drosehn = netel.rpi.edu
    > Senior Systems Programmer or org
    > Rensselaer Polytechnic Institute or edu[/ref]

    This is my '/etc/fstab':

    ================================================== ==================
    # Device Mountpoint FStype Options Dump Pass#
    /dev/ad2s4b none swap sw 0 0
    /dev/ad2s4a / ufs rw 1 1
    /dev/ad2s4e /tmp ufs rw 2 2
    /dev/ad2s4f /usr ufs rw 2 2
    /dev/ad2s4d /var ufs rw 2 2
    devfs /dev devfs rw 0 0
    /dev/acd0 /cdrom cd9660 ro,noauto 0 0
    /dev/fd0 /floppy msdosfs rw,noauto 0 0
    /dev/ad0s5 /mnt/w2k ntfs ro 0 0
    /dev/ad0s1 /mnt/wxp msdosfs rw 0 0
    /dev/ad2s1 /mnt/deb ext2fs rw,noauto 0 0
    /dev/da0s1 /mnt/cam msdosfs rw,noauto 0 0
    procfs /proc procfs rw 0 0
    linprocfs /compat/linux/proc linprocfs rw 0 0
    ================================================== ==================

    Please see the complete thread (there is more information there).

    Thanks and Best Regards,
    Ale
    Alejandro Guest

Similar Threads

  1. Problems with Samba and/or Sundance Ehternet Driver
    By Paul Galbraith in forum Debian
    Replies: 0
    Last Post: July 16th, 12:30 PM
  2. Replies: 0
    Last Post: July 14th, 12:50 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139