Two NICs. two SSH servers - SSH

This is a discussion on Two NICs. two SSH servers - SSH ; I have a Linux box with two NICs, on different networks, each with a static IP address of its own. How can things be arranged so that I have two SSH servers, each bound to a different NIC and on ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Two NICs. two SSH servers

  1. Two NICs. two SSH servers

    I have a Linux box with two NICs, on different networks, each with a
    static IP address of its own. How can things be arranged so that I have
    two SSH servers, each bound to a different NIC and on a different port?



  2. Re: Two NICs. two SSH servers

    Augustus SFX van Dusen wrote:
    > I have a Linux box with two NICs, on different networks, each with a
    > static IP address of its own. How can things be arranged so that I have
    > two SSH servers, each bound to a different NIC and on a different port?
    >
    >


    The ListenAddress parameter in your config file defines which address
    (and port) sshd will listen on. The -f flag when starting sshd will
    specify which config file it will use.


    Chris Mattern

  3. Re: Two NICs. two SSH servers


    "Chris Mattern" wrote in message
    news:12csvckni41to65@corp.supernews.com...
    > Augustus SFX van Dusen wrote:
    >> I have a Linux box with two NICs, on different networks, each with a
    >> static IP address of its own. How can things be arranged so that I have
    >> two SSH servers, each bound to a different NIC and on a different port?
    >>
    >>

    >
    > The ListenAddress parameter in your config file defines which address
    > (and port) sshd will listen on. The -f flag when starting sshd will
    > specify which config file it will use.


    Besides two distinct sshd_config files for this, it usually helps to have
    two different init scripts to start the daemons and two different PID file
    locations to avoid conflicts in restarting one or the other daemon.

    Why do you want to do this? If you have DNS pointing to one hostname and IP
    address, and DNS pointing to the other, You don't even need them to be on
    different TCP portnumbers, simply different "ListenAddress" settings. Any
    attempt to contact one server will automatically go to that port.

    I've used this sort of thing for machines with multiple ports, such as one
    address accessible on the outside WAN and another in the DMZ, to be able to
    pick which port I'm connecting to.



  4. Re: Two NICs. two SSH servers

    On Mon, 31 Jul 2006 19:54:53 GMT, Augustus SFX van Dusen wrote:
    > I have a Linux box with two NICs, on different networks, each with a
    > static IP address of its own. How can things be arranged so that I have
    > two SSH servers, each bound to a different NIC and on a different port?


    I suggest the following procedure, which will give you two distinct
    ssh daemons, each with its own policies. These instructions pertain
    to Redhat-style systems, your file paths might vary.

    Let's assume you already have ssh set up to listen on one NIC
    with the policies you want. Then, without too much detail:

    1. cp -p /etc/ssh/ssh_config /etc/ssh/otherssh_config
    Modify the new file as necessary for the policy you want.

    2. cp -p /etc/ssh/sshd_config /etc/ssh/othersshd_config
    Modify the new file as necessary. Most importantly, look
    at ListenAddress and Port.

    3. cp -p /etc/rc.d/init.d/sshd /etc/rc.d/init.d/othersshd
    Modify the new file to point to otherssh instead of ssh.

    4. cd /usr/sbin/
    ln -s sshd othersshd
    No changes to the executable

    5. cd /etc/pam.d/
    ln -s sshd othersshd
    No changes to the PAM module, usually

    Then when all the changes are done:
    6. chkconfig --add othersshd
    chkconfig --list | grep othersshd
    Should be on in levels 2345
    service othersshd start
    This should create a new set of keys.

    One drawback to this scheme: if you ever update ssh, it might change
    the config files or sshd init file, but it won't touch the
    otherssh files.

    --
    Dale Dellutri (lose the Q's)

  5. Re: Two NICs. two SSH servers

    On Mon, 31 Jul 2006 19:54:53 +0000, Augustus SFX van Dusen wrote:

    > I have a Linux box with two NICs, on different networks, each with a
    > static IP address of its own. How can things be arranged so that I have
    > two SSH servers, each bound to a different NIC and on a different port?


    Thanks to everybody that replied. Actually, much to my surprise, I do not
    really need this - my OpenSSH daemon sshd seems to listen for connections
    on all local NICs. The man pages for sshd_config confirm this.




+ Reply to Thread