How to setup a ssh connection to a remote host while booting a linux system (executing an init-script) ? - SSH

This is a discussion on How to setup a ssh connection to a remote host while booting a linux system (executing an init-script) ? - SSH ; Hello, I need help and hope that someone can send me an idea. I have to kill processes on a slave server while shutdown the master, and like to start these processes again while booting the master server again. A ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: How to setup a ssh connection to a remote host while booting a linux system (executing an init-script) ?

  1. How to setup a ssh connection to a remote host while booting a linux system (executing an init-script) ?


    Hello,

    I need help and hope that someone can send me an idea.

    I have to kill processes on a slave server while shutdown the master,
    and like to start these processes again while booting the master server again.

    A simple script with ssh-commands works fine while testing it interactively.

    But how can I setup the ssh-connection between both servers to call
    the scripts from inside an init script while booting the server?


  2. Re: How to setup a ssh connection to a remote host while booting a linux system (executing an init-script) ?

    Depends on your unix flavor,*usually you have to place commands in
    /etc/rc.d/rc.local or some such.

    i

    On Sun, 19 Sep 2006 17:22:33 GMT, Thomas Plaga@fz-juelich.de wrote:
    >
    > Hello,
    >
    > I need help and hope that someone can send me an idea.
    >
    > I have to kill processes on a slave server while shutdown the master,
    > and like to start these processes again while booting the master server again.
    >
    > A simple script with ssh-commands works fine while testing it interactively.
    >
    > But how can I setup the ssh-connection between both servers to call
    > the scripts from inside an init script while booting the server?
    >



  3. Re: How to setup a ssh connection to a remote host while bootinga linux system (executing an init-script) ?

    Thomas Plaga@fz-juelich.de wrote:
    > I have to kill processes on a slave server while shutdown the master,
    > and like to start these processes again while booting the master server again.


    A sensible slave server process should react appropriately to the master
    going down by means of the protocol through which they communicate.

    But in case you didn't write it, you could set up public key
    authentication with ssh. This means ssh can be ran non-interactively with:

    ssh user@host command

    How to do this is explained here under the part about "ssh-keygen":
    http://www.freebsd.org/doc/en_US.ISO...k/openssh.html

    Adding the aforementioned command to the shutdown scripts appropriate
    for your operating system[1] should allow you to remotely do stuff
    during shutdown.

    [1] SSH has been ported to a plethora of operating systems and my cat is
    currently taking a nap on the crystal ball, so I can't make any guesses
    right now.

+ Reply to Thread