# how to run two samba server?!

## SarahS93

Is there a guide how to setup up two samba server on one machine with different ports?

----------

## Harvey Walsh

[Moderator note: this post was ripped from https://wiki.samba.org/index.php/Multiple_Server_Instances, but is close enough to on-topic (and has legitimate responses) that I am leaving it in place for now. -Hu]

Each instance should operate on its own IP address (that independent IP address can be an IP Alias). Each instance of nmbd, smbd and winbindd should listen only on its own IP socket. This can be secured using the socket address parameter. Each instance of the Samba server will have its own SID also, this means that the servers are discrete and independent of each other.

----------

## SarahS93

ok, that sound good

but whats about the database with the users and passwords?

there is only one smbpasswd command if i will run two samba server?

----------

## Hu

 *Harvey Walsh wrote:*   

> that independent IP address can be an IP Alias

 Could you elaborate on this?  The only place I have seen aliases mentioned in the context of IP addressing is in the ifconfig documentation, which recommends that as a workaround for its inability to directly manage multiple addresses on a single interface.

SarahS93: do you want the user databases to be separate?  If yes, configure each server with a unique path to its user database.

----------

## SarahS93

oke

what is about the start, stop and reload init scripts?

dont know how to make a /etc/init.d/samba2 script

can anyone give mit some example please?!?

----------

