Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2 strange samba problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ViViDVeW
n00b
n00b


Joined: 24 Jan 2004
Posts: 30
Location: Rochester,NY

PostPosted: Tue Jun 01, 2004 9:36 pm    Post subject: 2 strange samba problems Reply with quote

ok been reading the fourms for a while now and they have been a lot of help but i have finaly come across a problem i cant figure out for the life of me.

running gentoo 2.4.25 gs-sources and samba 3.0.2a on a PIII with 2 ide HDs and XP Pro on a 2.4GHz P4 as the client

1st problem is any samba share pointed at the mount point (or any subdir of the mount point) for /dev/hdb1 does not look at the directory. it looks at /tmp, but the local file system sees the mount in the correct place and any share pointed somewhere on hda works fine. My solution to this was to mount hdb1 to the /tmp dir so the samba share and the local file system are in sync, but i want to put a third drive in and don't know if 2 drives can be mounted to the same dir.

2nd problem is that only root can access the samba shares from my xp machine. other users can see but not even browse the shares.
user is listed in samba passwd file
smbpasswd -a steve
and entered the same passwd used on local account
i have checked and made sure permisions are correct for the whole dir tree
chmod -r 777 /tmp
even chaged the owner of the files to see if it worked
chown -r steve /tmp

my smb.conf file is listed below
[global]
workgroup = Thevew
netbios name = Gentoobox
server string = Samba Server %v
log file = /var/log/samba3/log.%m
max log size = 50
hosts allow = 192.168.1. 127. 129.21.129.93
security = user
smb passwd file = /etc/samba/private/smbpasswd
local master = yes
os level = 33
preferred master = yes
dns proxy = no

[120GB]
path /tmp
valid users = root
writeable = yes
public = no
write list = root
[ritter]
path /tmp
valid users = steve
writeable = yes
public = no
write list = steve


any help would be great and thanx
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Tue Jun 01, 2004 10:03 pm    Post subject: Reply with quote

Your first problem is easily solved and, I think, solving may sort the other.

The syntax in smb.conf for a path is
Code:
path = /path/to/path

not
Code:
path /path/to/path

It is very important after making changes to smb.conf to run testparm to make sure your syntax is correct. If you had done this you would have seen something like.
testparm wrote:
Processing section "[cd]"
params.c:Parameter() - Ignoring badly formed line in configuration file: path /mnt/cdrom
No path in service cd - using /tmp

Sound familiar?
Back to top
View user's profile Send private message
ViViDVeW
n00b
n00b


Joined: 24 Jan 2004
Posts: 30
Location: Rochester,NY

PostPosted: Tue Jun 01, 2004 10:28 pm    Post subject: Reply with quote

yup samba looks at the correct dir now. cant believe i didnt catch that basic of an error. thanx i didnt know about testparm i'm still not too good with linux and brand new to samba and smb.

still having the 2nd problem tho. cant get any user access to any share unless they log into samba as root.

thanx agian.
Back to top
View user's profile Send private message
chio
n00b
n00b


Joined: 24 Dec 2003
Posts: 4

PostPosted: Wed Jun 02, 2004 8:05 am    Post subject: Re: 2 strange samba problems Reply with quote

ViViDVeW wrote:

[120GB]
path /tmp
valid users = root
writeable = yes
public = no
write list = root
[ritter]
path /tmp
valid users = steve
writeable = yes
public = no
write list = steve[/color]

any help would be great and thanx


try

[ritter]
path = /yourdir
username = steve
admin users = steve
only user = yes
read only = no
Back to top
View user's profile Send private message
ViViDVeW
n00b
n00b


Joined: 24 Jan 2004
Posts: 30
Location: Rochester,NY

PostPosted: Wed Jun 02, 2004 4:17 pm    Post subject: Reply with quote

thanx for the sugestion but no dice.
cant figure out what i'm doing wrong
keep whondering if i am setting up linux local accounts wrong
useradd -g sambashare steve
passwd steve
smbpasswd -a steve

as far as i know that's all that must be done to add a user for samba sharing, but it don't work.
the only account that works is the one i didn't make (root)
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Wed Jun 02, 2004 4:20 pm    Post subject: Reply with quote

could you post the share section for one share from smb.conf and the output from ls -l for the directory above the share root.
Back to top
View user's profile Send private message
ViViDVeW
n00b
n00b


Joined: 24 Jan 2004
Posts: 30
Location: Rochester,NY

PostPosted: Wed Jun 02, 2004 6:10 pm    Post subject: Reply with quote

ok been reading and playing around. still cant make it work but found something that would seem to be related. Unless root is in the smbpasswd file, no other user can even see the shares on the network. Samba never even asks for authentication. WinXP displays the access denied dialog if the samba machine is accessed at all, not just the shares.
Back to top
View user's profile Send private message
ViViDVeW
n00b
n00b


Joined: 24 Jan 2004
Posts: 30
Location: Rochester,NY

PostPosted: Wed Jun 02, 2004 6:20 pm    Post subject: Reply with quote

//this works
Code:

[120GB]
        path = /mnt/120GB
        valid users = root
        writeable = yes
        public = no
        write list = root
        hide dot files = yes

this does not
Code:

[try]

        path = /mnt/120GB
        valid users = admin
        writable = yes
        public = no
        write list = admin

Code:

llocalhost / # ls -l /mnt/120GB/
total 1060796
drwxrwxrwx  24 admin root      4096 Jun  1 20:37 desktop_mydocs
drwxrwxrwx  11 admin root      4096 Jun  2 09:50 downloads
-rwxrwxrwx   1 admin root 361725450 Jun  1 01:54 jake.2.0.116.ws.pdtv.xvid.r-river.avi
-rwxrwxrwx   1 admin root 361698514 May 28 20:46 jake.2.0.s01e14.ws.pdtv.xvid-river.avi
-rwxrwxrwx   1 admin root 361714854 May 21 10:39 jake.2.0.s01e15.ws.pdtv.xvid-river.avi
drwxrwxrwx   2 admin root     16384 May 31 16:18 lost+found
drwxr-xr-x   3 admin root      4096 May 31 22:12 public
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Wed Jun 02, 2004 6:24 pm    Post subject: Reply with quote

can we see some output from the samba log

Also start with something simple on your shares

[sharename]
path = /path
writeable = yes

this is a good start once that's working add more lines
Back to top
View user's profile Send private message
ViViDVeW
n00b
n00b


Joined: 24 Jan 2004
Posts: 30
Location: Rochester,NY

PostPosted: Wed Jun 02, 2004 6:49 pm    Post subject: Reply with quote

ok tried a simpler share section but still does not work
if i'm using user level security don’t I need to tell a share what users have access
Code:
valid users = user_name


global section of smb.conf has not changed since my 1st post

last session output from log.nmbd
Code:
 [2004/06/02 13:34:24, 0] nmbd/nmbd.c:terminate(54)
  Got SIGTERM: going down...
[2004/06/02 13:34:26, 0] nmbd/nmbd.c:main(664)
  Netbios nameserver version 3.0.2a started.
  Copyright Andrew Tridgell and the Samba Team 1994-2004
[2004/06/02 13:34:26, 0] nmbd/nmbd.c:main(683)
  standard input is not a socket, assuming -D option
[2004/06/02 13:34:48, 0] nmbd/nmbd_become_lmb.c:become_local_master_stage2(396)
  *****

  Samba name server GENTOOBOX is now a local master browser for workgroup THEVEW on subnet 192.168.1.13

  *****

output for log.smbd
Code:
 [2004/06/02 13:34:25, 0] smbd/server.c:main(747)
  smbd version 3.0.2a started.
  Copyright Andrew Tridgell and the Samba Team 1992-2004

omited the full log b/c rather long and say the same thing over and over agian except the problem of invalid formated path statement which is now solved
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Wed Jun 02, 2004 7:06 pm    Post subject: Reply with quote

could you show ls -l for /mnt

you only need to specify valid users if you want to limit the users. Also you only need write list for read only shares.


What happens if you create a share with public = yes
Back to top
View user's profile Send private message
ViViDVeW
n00b
n00b


Joined: 24 Jan 2004
Posts: 30
Location: Rochester,NY

PostPosted: Wed Jun 02, 2004 7:24 pm    Post subject: Reply with quote

Code:
localhost samba # ls -l /mnt
total 12
drwxrwxrwx  6 admin root 4096 Jun  2 10:57 120GB
drwx------  2  1002 root 4096 Feb 18 23:28 cdrom
drwx------  2  1002 root 4096 Feb 18 23:28 floppy


public = yes
works and lets anyone in without asking for a passwd but only if root is listed in smbpasswd otherwise no access to the machine is allowed at all

not that i care yet but from outside the subnet it still asks for a passwd and will not grant access
Back to top
View user's profile Send private message
ViViDVeW
n00b
n00b


Joined: 24 Jan 2004
Posts: 30
Location: Rochester,NY

PostPosted: Fri Jun 04, 2004 2:23 am    Post subject: Reply with quote

Ok after about a day of reading and screwing around its works.

couldn’t figure it out until started reading the steps used by samba to authenticate users.

this would only come up if testing multiple samba accounts from the same client.
once winXP finds a user passwd combo that works for a smb server it will always try to log in as that user. So if you try the user and passwd for another users share from the same xp client access will be denied b/c samba or smb(not sure which) will not allow multiple connections from the same IP or netbios name(again not sure which)

the reason only root would work was b/c it was the first user I tried from both xp clients I was using for testing.

thanx for the help nobspangle

next problem 
anyone know how to wipe windows remembered share username and passwords b/c I had to create new winxp accounts with no memory of what they thought the share passwds where to get this to work.
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Fri Jun 04, 2004 7:24 am    Post subject: Reply with quote

I think the moral here is that root shouldn't be used to access samba shares. The best thing to do is to use the same username and password as you use for your xp account, that way you will never be asked for a username and password.
Back to top
View user's profile Send private message
ViViDVeW
n00b
n00b


Joined: 24 Jan 2004
Posts: 30
Location: Rochester,NY

PostPosted: Fri Jun 04, 2004 1:50 pm    Post subject: Reply with quote

true. true.

i knew it wasnt the greatest idea but it was only for testing.
it seems that the way windows cashes passwd for smb shares i would have had the same problem with whatever account i tried first.

i was using different passwds b/c i was testing giving friends access to my movies and didnt want them to have to tell me their winxp passwds

is there a systax for passing the user name and passwd from windows as you access a share ie for ftp ftp://username:passwd@www.ftpsite.com
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Fri Jun 04, 2004 5:23 pm    Post subject: Reply with quote

if you do map network drive there is an option to connect using a different username and password.

Also you can use the net use command
net use \\computername\sharename /user:username password

Then windows will try to connect using that uername password combination for that share for the rest of the session.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum