# samba

## Tanisete

Hi to all!

I'm trying to configure my samba network at home, and i'm having problems. I had tried to copy the smb.conf from the guide changing some parameters that fit my network, and that is the result:

[global]

# Replace MYWORKGROUPNAME with your workgroup/domain

workgroup = GRUPO_TRABAJO

# Of course this has no REAL purpose other than letting

# everyone know its not Windows!

# %v prints the version of Samba we are using.

server string = Samba Server %v

# We are going to use cups, so we are going to put it in here  :Wink: 

printcap name = cups

printing = cups

load printers = yes

# We want a log file and we do not want it to get bigger than 50kb.

log file = /var/log/samba/log.%m

max log size = 50

# We are going to set some options for our interfaces...

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# This is a good idea, what we are doing is binding the

# samba server to our local network.

# For example, if eth0 is our local network device

interfaces = lo eth0

bind interfaces only = yes

# Now we are going to specify who we allow, we are afterall

# very security conscience, since this configuration does# not use passwords!

hosts allow = 127.0.0.1 213.96.214.0/24

hosts deny = 0.0.0.0/0

# Other options for this are USER, DOMAIN, ADS, and SERVER

# The default is user

security = share

# No passwords, so we're going to use a guest account!

guest account = samba

guest ok = yes

# We now will implement the on access virus scanner.

# NOTE: By putting this in our [Global] section, we enable

# scanning of ALL shares, you could optionally move

# these to a specific share and only scan it.

#vfs object = /usr/lib/samba/vfs/vscan-clamav.so

#vfs options = config-file = /etc/samba/vscan-clamav.conf

# Now we setup our print drivers information!

[print$]

comment = Printer Drivers

path = /etc/samba/printer # this path holds the driver structure

guest ok = nobrowseable = yes

read only = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

write list = root

# Now we'll setup a printer to share, while the name is arbitrary

# it should be consistent throughout Samba and CUPS!

[HPDeskJet3550]

comment = HP DeskJet 3550 Network Printer

printable = yes

path = /var/spool/samba

public = yes

guest ok = yes

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = root

# Now we setup our printers share.  This should be

# browseable, printable, public.

[printers]

comment = All Printers

browseable = yesprintable = yes

public = yes

guest ok = yes

path = /var/spool/samba

# Modify this to "username,root" if you don't want root to

# be the only printer admin)

printer admin = root

# We create a new share that we can read/write to from anywhere

# This is kind of like a public temp share, anyone can do what

# they want here.

[public]

comment = Public Files

browseable = yes

public = yes

create mode = 0766

guest ok = yes

path = /home/samba/public

What i wanted was to let the samab public as a zone that anyone through the net can write os read. But when i try to enter the server in other computers, or even in mine, a password is asked. I've tried guest, invitado, and no password at all without sucess. What is the problem? 

Thanks a lot!!

pd: i've forgotten to put the output of the smbclient:

smbclient -L localhost

Password: 

session setup failed: NT_STATUS_LOGON_FAILURE

and the log from samba:

[2004/05/25 22:35:59, 0] passdb/pdb_smbpasswd.c:startsmbfilepwent(189)

  startsmbfilepwent_internal: file /etc/samba/private/smbpasswd did not exist. F

ile successfully created.

[2004/05/25 22:35:59, 1] auth/auth_util.c:make_server_info_sam(821)

  User samba in passdb, but getpwnam() fails!

[2004/05/25 22:36:25, 1] auth/auth_util.c:make_server_info_sam(821)

  User samba in passdb, but getpwnam() fails!

[2004/05/25 22:36:25, 1] auth/auth_util.c:make_server_info_sam(821)

  User samba in passdb, but getpwnam() fails!

...

----------

## nobspangle

your guest user is called Samba,

have you created a samba user called samba and mapped it to a unix user that has access rights to the directories you want to share?

----------

## Tanisete

how can i do that? with smbpasswd? do i have to create the user for linux too? I haven't done this before.

Thanks for the answer!

----------

## sak102010

I'd recommend changing to ...

```

security = user

```

It looks like you're just setting up a simple standalone server to host some shares and printers.  Using share level security has been known to cause problems.  I'd suggest reading this to get a better idea...

http://us1.samba.org/samba/docs/man/howto/ServerType.html#id2515180

Also, from your log output, you haven't setup any of the accounts in your /etc/private/smbpasswd file.  You are correct in thinking that smbpasswd will do this for you ...

```

smbpasswd -a username

```

You'll need to do this for any user that you want to be able to access the shares, including the guest user.  For any account in your regular /etc/passwd file, that you don't want to have access to the machine (i.e. shell, home directory), but still be able to use the samba shares, I'd suggest something like ...

```

useradd -d /dev/null -s /bin/false username

```

----------

## Tanisete

thanks a lot sak! now i've done what you said and from linux machines it works, but if i try to access from other windows xp machine (that's actually what i wanted) it continue saying that it has no access to the share. And the strange thing is that i have no log from samba of bad access or access ok... i've tried putting 0.0.0.0/0 in host-allow but without success. Maybe something to do with permissions? but with smb4k it's all ok (i can also write) so i don't know what can happen. I also changed security to user.

Any ideas? 

 :Confused: 

----------

## sak102010

I'm not very well versed with WinXP, my network uses Win2k machines.  But if I remember correctly, from my bits of time with XP, there is a built-in firewall in WinXP that is enabled by default.  Make sure that's turned off, as it can cause no end to trouble.

That's the only thing that I can think of right off.

----------

## Tanisete

I've been testing some configurations and after all the share security level has made everything go well. I don't know why, but with user security level i wasn't able to see anything (windows was  not capable) and now it's possible. The firewall was off, yes  :Smile: . Thanks for the answers, i will investigate   :Wink: 

Thanks for the help!

----------

## quickshiftin

I am running Gentoo on an IBM R51 laptop that has been furnished by my current employer.  Not only did they give me the laptop, but they sprung for a VMware license so i can still develop windows apps for their network.  well i have been wanting samba on this thing since i started setting up gentoo and this afternoon i have sat down to get it running.  i was reading through the  Gentoo Samba3/CUPS/ClamAV HOWTO  and following the instructions but i decided to trim it down a bit.  At this point i want only to share files between both OS, printing can wait and so can virus checking, since i will be the only one working with the files and my windows environment is isolated in the first place.

Well i modified the  /etc/samba/smb.conf  file to reflect these goals and all of a sudden i couldnt get the server running anymore via

/etc/init.d/samba start invocation

an examination of the logs showed the following 

 *Quote:*   

>  Copyright Andrew Tridgell and the Samba Team 1992-2004
> 
> [2005/09/23 22:56:10, 1] auth/auth_util.c:make_server_info_sam(807)
> 
> User samba in passdb, but getpwnam() fails!

 

as i am tempted to post on the forum and ask for someone w/ more knowledge than me to lend a hand i hold back as long as possible, and try to solve problems on my own.  this time it payed off!  i read nearly every post that seemed to be related to my issue and finally i picked up on a tip from  nobspangle

[code="nobspangle"]your guest user is called Samba,

have you created a samba user called samba and mapped it to a unix user that has access rights to the directories you want to share?[/code]

here was the critical snippet from my /etc/samba/smb.conf file

```
guest account = samba
```

the guide is a bit ambiguous when it discusses a guest account, but i put 2 and 2 together and realized i did not have an account named  samba  i saw suggestions on other threads that said just make an account with username = samba, strangely on my system

 *Quote:*   

> useradd -d /dev/null -s /bin/false samba
> 
> useradd: group samba exists - if you want to add this user to that group, use -g.

 

how does that make sense??? even if i have a group named samba cant i still have a user named samba as well?? oh well at any rate i decided to use my primary user account and changed the config file and now i have the thing running again.

if i get it working i will post again...

-quickshiftin

----------

## quickshiftin

well i got it working.  there were a few small permissions issues to hammer out, but altogether it wasnt that hard.  when i get back on the net with may laptop ill post my /etc/samba/smb.conf settings in case anyone else is interested.

-quickshiftin

----------

