Re: ssh from a script -- can't install keys

On Mon, 08 Mar 2010 11:33:56 -0800, Bob Smith wrote:

I wonder if anyone on this group has a working script to ssh to a remote
system and execute a command.

Google turns up several suggestions but none of them seem to work. In
particular EXPECT does not work, which is a shame.

The ssh client where the script is to run is using OpenSSH 4.7.

BTW: the target device is a tape drive. I have access to a login that
takes me directly to a CLI where I need to run a few commands. I DO NOT

Does anyone have ssh with password authentication working from a

Bob Smith

Why wouldn't expect work? That is the usual solution to this kind of
problem. Are you familiar with 'autoexpect'? You can use it to script
your ssh session to the tape drive. The result is far too specific to
run without modification, but it does give a good framework that can be
changed to be general enough to be of use.

Relevant Pages

  • Scripts using SSH and SSH_ASKPASS
    ... To test SSH scripts you better destroy the control TTY. ... The trick is to run YOUR script on YOUR local ... As for the password relaying command: this needs not be an X command. ... # we read one line from a temporary pipe. ...
  • Re: remote server backup script
    ... > Just type away at the command line. ... Make a backup of whatever you want ... > command line, in a script. ... >>the server ssh key on the clients machine). ...
  • Re: [PHP] SSH and php
    ... % % Is it possible to run a SSH command from php? ... it's possible to run any command from php. ... There are ways to do that -- I personally would create a kick script ...
  • Using SSH to terminate remote systems for disaster recovery
    ... I have a need to terminate a number of AIX 5.1 systems ... from a single script. ... I can do this using ssh. ... if I issue the shutdown command from ssh, ...
  • RE: Execute script on remote computer
    ... Execute script on remote computer ... you should just use the ssh command coupled with the name of the ...