# Install Samba

## Black666

Hi!

I installed samba with emerge samba and I'm currently configuring it with the help of some how-to's

What I've read I can either start it with a script that executes smbd and nmbd or through the file /etc/inetd.conf

From my suse installation I know the file inetd.con but at gentoo I haven't found it ... instead I've found something like xinetd.

How do I open/close ports through xinetd (I will start samba through a script now, but I would like to know anyway)?

Plus: I started the two samba daemons but I can't connect to swat through port 901 

Maybe it's something about xinetd and ports?

----------

## mksoft

 *Black666 wrote:*   

> Hi!
> 
> I installed samba with emerge samba and I'm currently configuring it with the help of some how-to's
> 
> What I've read I can either start it with a script that executes smbd and nmbd or through the file /etc/inetd.conf
> ...

 

Emerge xinted and add it to the default runlevel:

```
rc-update add xinted default
```

xinetd services are controlled via conf files in /etc/xinetd.d. AFAIK,  services installed after emerge are disabled by default.

 *Black666 wrote:*   

> 
> 
> Plus: I started the two samba daemons but I can't connect to swat through port 901 
> 
> Maybe it's something about xinetd and ports?

 

swat is a seperate service, and is not started by smbd/nmbd. When you install samba, you'll get a files named swat in /etc/xinted.conf. The file looks like this (after install):

```
# default: off

# description: SWAT is the Samba Web Admin Tool. Use swat \

#              to configure your Samba server. To use SWAT, \

#              connect to port 901 with your favorite web browser.

# $Header: /home/cvsroot/gentoo-x86/net-fs/samba/files/swat.xinetd,v 1.3 2002/05

/06 19:57:08 woodchip Exp $

service swat

{

        port            = 901

        socket_type     = stream

        wait            = no

        only_from       = localhost

        user            = root

        server          = /usr/sbin/swat

        log_on_failure += USERID

        disable         = yes

}
```

If you want it activated, change disable to no. When xinted will be started, it'll activate swat upon connection attempt to port 901.

For the rest, read the man pages for xinetd.

----------

## Black666

Thnx ... now I can connect to port 901 but somehow he doesn't accept my root username+password!!??

Plus I'm not able to share a folder for my W2K domain ... the same problem as with swat - he wants username + pw but accepts nothing (not even root account). Any hints how I can share a folder without authentication, just a tmp folder for everyone to read/write

----------

## Black666

Ok, I now generated a smbpasswd file with

```
cat /etc/passwd | mksmbpasswd.sh > /usr/local/samba/private/smbpasswd
```

and set a password for root with

```
smbpasswd
```

Now I can connect to the shares using root username+pw .... but how do I make shares available that everyone can read/write without authentication.

@swat: How can I access swat from remote computers? I removed the "only_from = localhost" from the swat file in xinet.d but I still can only connect from localhost!?

Btw: Does someone know a good samba how-to or guide? The how-to's I'm reading are a bit confusing...

----------

## Pasoa2000

Check the doc's on www.linuxnewbie.org - they have a fairly straightforward section on setting up samba.  As for connecting to win2k machines - with the guest account disabled there is no anonymous access.

----------

