Find the answer to your Linux question:
Results 1 to 5 of 5
Hi Experts, I want to make a utility that could ease my work a bit. In my Job, I telnet into a server remotely and then SSH different matchines through ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    2

    Software for SSH Commands scripts?


    Hi Experts,

    I want to make a utility that could ease my work a bit.

    In my Job, I telnet into a server remotely and then SSH different matchines through that server, I run multiple linux commands on those matchines then. I use PUTTY ssh client for this purpose.

    I want to write a script that enters multiple/series of commands as I list them in the script. Is there any software for this purpose? I will be glad if you people could shed some light on it.

    Thanks, Ali

  2. #2
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,127
    If you can write a bash script (either natively on Unix or through Cygwin or similar in Windows).

    Check this link for a few ideas on the script.

  3. #3
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Also, expect is ideally suited for this kind of thing. You can have autoexpect "watch" your session and it will produce an expect script based on what it observed.

  4. #4
    Just Joined!
    Join Date
    Aug 2008
    Posts
    2
    Hi,

    Thanks for your replies. Yeah that "Expect" software is what I require I guess. As I'm a beginer in this scripting area, so I would appritiate if some one could share a tutorial on how to use this "Expect" software to write scripts?

    There are some things which I'm trying to figure out. I copied this software from said location from its website but it contains a group of text files and some other files only. Do we have to write scripts on simple text file? or this software could provide some GUI etc and later we convert file into .EXE?

    For Example: If some one could list general steps to write a simple script using this "Expect" software that automatically telnet on a webserver(ww.xx.y.zz) and input user name=x and password=y.

    Waiting for your replies.

    Thanks, Ali

  5. #5
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Did you download the tar.gz file? If so, (generic) instructions for installing tar.gz files can be found here. However, for more detailed instructions for expect, open up the INSTALL file that comes with the package. I popped it open and there's quite a good explanation of what needs to be done in order for expect to install.

    As for your second question, I'm not sure if expect can interact with user input. At least, I have never used it in that way. If you need that (i.e. you can't just have it work for one user) you may have to switch to something that's a little more sophisticated and can handle interaction.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •