Using ssh to Install on Remote Server

Discussion in 'Programming/Scripts' started by simonmorty, Mar 3, 2009.

  1. simonmorty

    simonmorty New Member

    Hi As a Linux newbie I have the following question\problem - I want to connect from my Linux desktop to a remote server with a script that will log on, run a setup\install process on the Unix box to install a Java program & disconnect is SSH the way to go?, can someone outline the rough order of steps involved? I plan to have a go at a bash script if possible.
    Thanks in advance...
     
  2. id10t

    id10t Member

    Yes, you can do that with ssh, may need to look into using ssh keys for login or you will need to see if expect & send still work (its what i used years ago for dialup scripting)
     
  3. steve_mayes

    steve_mayes New Member

    Is the remote server debian?

    Yes, you can use a shell script for that. Use a digital key for security on ssh.

    If so then you can use apt-get to install the basics and can use echo or cat with '>>' to add lines to text configuration files.

    If not you'll have to use whichever package manager is appropriate (Yum for Red Hat based systems or YAST for suse systems)

    If that isn't an option you'll have to 'roll your own' from a tarball (a tar.gz / tar.bz file). In that case look at the --prefix= option for configure so that you can put the files associated with an app all in one place (I use --prefix=/opt/app_name). This makes uninstallation and maintenance easier.

    you may want to log any errors so have a look at command exit codes.

    don't forget that if you roll your own you may have to set up startup scripts or configure the app for an automatic start in some other fashion.

    Get yourself an IBM developerworks subscription (it's free) and have a look at their shell scripting tutorial.

    Hope this helps.
     

Share This Page