[Help] Can't access Samba from neither Windows nor Linux

Don´t be shy, Linux is fun! =)
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

[Help] Can't access Samba from neither Windows nor Linux

Post by ayu »

Ok so I setup samba on my server for a project I'm working on, and here's my smb.conf

[global]
; General server settings
netbios name = Teresa
server string =
workgroup = Hotline
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

passdb backend = tdbsam
security = user
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast

wins support = yes

printing = CUPS
printcap name = CUPS

syslog = 1
syslog only = yes

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[print$]
path = /var/lib/samba/printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0664
directory mask = 0775

[printers]
path = /tmp
printable = yes
guest ok = yes
browseable = no

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[Downloads]
path = /mnt/gb100/tfluxdl/cats
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = cats
force group = cats


with this conf, for some reason when I enter the username and password in Windows, it just popups the login window again (you know like it does in Windows when you enter the wrong password. Yeah, not so very clever :( ) .... And when I press cancel and click the resource again it says "can't find group name" or something.

And when I try to enter in Linux it just says "Can't mount Windows volume".


thing is, that if I remove
force user = cats
force group = cats
from the config, it works, but it doesn't seem to have the same protection. What exactly is the difference? and why doesn't it work? =/
Last edited by ayu on 26 Aug 2008, 04:09, edited 1 time in total.
"The best place to hide a tree, is in a forest"

User avatar
Still_Learning
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 1040
Joined: 11 Jun 2008, 16:00
15
Location: Trigger City

Post by Still_Learning »

I clicked on a bunch of things and got it to work, samba - win file sharing but can not tell you how secure it is.. just how i got it to work, dont know anything about editing the config files. But I can currently access any system in the house that is windows from my ubuntu system. when you login make sure you have the \\pcname\whatever and have the windows pc set up with a UN and PW, from what i heard if their is no UN or PW it wont work at all, has to be done, along with enabling printer and filesharing on windows control panel, its probuly a problem more on the windows side then the linux side

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

hmmm....you seem to use the default password type (plaintext ones, not encrypted ones)...this is ok for *nix systems because it can use the /etc/passwd file then, but MS systems don't support this out of the box.
you have to edit the registry:

Code: Select all

HKEY_LOCAL_MACHINE\system\CurrentControlSet\Services\Rdr\Parameters\
create the entry:

Code: Select all

EnablePlainTextPassword:REG_DWORD=1
don't forget the reboot, should work then... :-k

of course you could use encrypted ones too which would need no changes on the MS box, but more work is needed on the *nix system then...so as long as the shares are only locally and not through the internet it's no problem... :wink:

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

hmmm, odd.... then why does it work when I remove "force user and group" ? I mean I can enter the password then and it works =/
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

ummm...is there a user AND a group named "cats" on the Linux system? and is the user cats member of the group cats?
you can find the groups in /etc/group, to check if the user cats is a member of the group cats check it with:

Code: Select all

groups cats
:-k

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

yeah the group exists =/


But, the thing is... it's working, which is confusing me. What is the difference between having "force user/force group" and not having? and does it pose a threat?
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

um, is the share owned by cats/cats? because if it's owned by root for example it will not work, simply because the permissions are not given.
and this is what the "force" option does: if your force "cats" only files that are owned by the user cats can be manipulated, files owned by root for example can't....and if you create or move a file into the share it sets the owner/group to cats too then.
move a file from the MS box to the share on Linux and check what owner/group is set for the file... :-k

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

Did ls -l and it seems root is the owner, and even if I do chown -R cats:cats /mnt, it won't change =/


I chmoded the folders though to 777
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

did a chgrp -R cats /mnt too to set the group?

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

bad_brain wrote:did a chgrp -R cats /mnt too to set the group?
shouldn't chown do that as well? ? =/
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

umm...oh, wait, you used cats:cats....I am not using that syntax, I am used to the good old chgrp command.
darn, now it's getting complicated...give me some time to think about it...
:lol:

Post Reply