Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Samba problems

1 view
Skip to first unread message

Alejandro Pulver

unread,
Mar 26, 2005, 10:29:09 AM3/26/05
to freebsd-questions
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

Stefan Haglund

unread,
Mar 26, 2005, 10:59:11 AM3/26/05
to Alejandro Pulver, freebsd-questions
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

>_______________________________________________
>freebsd-...@freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"
>
>
>

Alejandro Pulver

unread,
Mar 26, 2005, 11:54:37 AM3/26/05
to Stefan Haglund, freebsd-questions
On Sat, 26 Mar 2005 16:59:11 +0100
Stefan Haglund <stefan....@crystalnorth.com> wrote:
>
> 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
>

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.).

Alejandro Pulver

unread,
Mar 26, 2005, 11:59:06 AM3/26/05
to Alejandro Pulver, Stefan Haglund, freebsd-questions

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

Stefan Haglund

unread,
Mar 26, 2005, 2:43:10 PM3/26/05
to Alejandro Pulver, freebsd-questions
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

Fabian Keil

unread,
Mar 26, 2005, 2:37:51 PM3/26/05
to Alejandro Pulver, freebsd-questions
Alejandro Pulver <alej...@varnet.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

fk@r51 /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.

fk@r51 /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

Alejandro Pulver

unread,
Mar 26, 2005, 3:44:31 PM3/26/05
to Fabian Keil, freebsd-questions

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.

Fabian Keil

unread,
Mar 27, 2005, 4:02:44 AM3/27/05
to Alejandro Pulver, freebsd-questions
Alejandro Pulver <alej...@varnet.biz> wrote:

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

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?



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

If you only want read access, this looks fine.

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

Alejandro Pulver

unread,
Mar 27, 2005, 1:32:35 PM3/27/05
to Fabian Keil, freebsd-questions
On Sun, 27 Mar 2005 11:02:44 +0200
Fabian Keil <freebsd...@fabiankeil.de> wrote:

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 //guest@ale/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".

Fabian Keil

unread,
Mar 28, 2005, 8:17:57 AM3/28/05
to Alejandro Pulver, freebsd-questions
Alejandro Pulver <alej...@varnet.biz> wrote:

> I saw in SWAT that the connection from the other machine was mapped to

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

Alejandro Pulver

unread,
Mar 28, 2005, 12:22:45 PM3/28/05
to Fabian Keil, freebsd-questions
On Mon, 28 Mar 2005 15:17:57 +0200
Fabian Keil <freebsd...@fabiankeil.de> wrote:

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

Garance A Drosihn

unread,
Mar 29, 2005, 11:52:15 AM3/29/05
to Alejandro Pulver, freebsd-questions
At 12:29 PM -0300 3/26/05, Alejandro Pulver wrote:
>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').

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?

>Note: I have subdirectories under '/mnt' like 'w2k', 'wxp',
>'cam', and 'tmp'.
>
>What am I doing wrong?

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 = g...@gilead.netel.rpi.edu
Senior Systems Programmer or g...@freebsd.org
Rensselaer Polytechnic Institute or dro...@rpi.edu

Alejandro Pulver

unread,
Mar 29, 2005, 2:08:09 PM3/29/05
to Garance A Drosihn, freebsd-questions
On Tue, 29 Mar 2005 11:52:15 -0500
Garance A Drosihn <dro...@rpi.edu> wrote:

> At 12:29 PM -0300 3/26/05, Alejandro Pulver wrote:
> >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').
>
> 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.
>

Yes.

> 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?
>

The NTFS slice I mount at '/mnt/w2k' is in the server. I only have two
machines.

> >Note: I have subdirectories under '/mnt' like 'w2k', 'wxp',
> >'cam', and 'tmp'.
> >
> >What am I doing wrong?
>
> 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 = g...@gilead.netel.rpi.edu
> Senior Systems Programmer or g...@freebsd.org
> Rensselaer Polytechnic Institute or dro...@rpi.edu

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).

0 new messages