# ssh and postfix with xinetd

## Robyn Hood

I'm trying to get sshd and postfix to work by xinetd.

I can use them both fine when I start them like this:

/etc/init.d/ ... start

but when I try to start them through xinetd, the conection is refused:

$ ssh 192.168.0.10

ssh: connect to host 192.168.0.10 port 22: Connection refused

Similar message when I try to send an email to the same address.

Telnet however works fine though xinetd.

Here are my configuration files:

# cat /etc/xinetd.conf

defaults

{

        only_from      = 192.168.0.0

        bind           = 192.168.0.10

        instances      = 60

        log_type       = SYSLOG authpriv info

        log_on_success = HOST PID

        log_on_failure = HOST

        cps            = 25 30

}

includedir /etc/xinetd.d

# cat /etc/xinetd.d/telnetd

service telnet

{

        flags           = REUSE

        socket_type     = stream

        wait            = no

        user            = root

        server          = /usr/sbin/in.telnetd

        log_on_failure += USERID

        disable         = no

}

# cat /etc/xinetd.d/sshd

service ssh

{

        flags           = REUSE

        socket_type     = stream

        wait            = no

        user            = root

        server          = /usr/sbin/sshd

        log_on_failure += USERID

        disable         = no

}

# cat /etc/xinetd.d/postfix

service smtp

{

        flags           = REUSE

        socket_type     = stream

        wait            = no

        user            = root

        server          = /usr/sbin/postfix

        log_on_failure += USERID

        disable         = no

}

I have stopped postfix and sshd and restarted xinetd.

Anyone see what I'm doing wrong?

----------

## Arno

I'm using ssh from xinetd as well, here's the relevant config I have:

```
service ssh

{

        socket_type = stream

        protocol    = tcp

        port        = 22

        user        = root

        wait        = no

        server      = /usr/sbin/sshd

        server_args = -i

}
```

I think the port line is redundant as the SSH port is specified in /etc/services. However the protocol line may be required as /etc/services lists tcp and udp ports for SSH.

[Edit]I forgot: the server_args is probably required for SSH. It specifies that sshd is being run from (x)inetd.[/Edit]

As for Postfix, I am not sure you can have xinetd spawn it. Postfix requires several its daemons to run in order to work. If using xinetd is really a requirement for your MTA, you may want to try Exim, as it can run from xinetd.

----------

## Robyn Hood

Thanks, that's sorted out sshd.

I'll have a look into exim.

----------

