Re: can sshclient execute a local command ?



On Jul 23, 2009, at 12:51 AM, J. Bakshi wrote:

well, using the alias is a brilliant idea, but I have multiple hosts and they have different fwknop encryption password. That's why I stored all the server info at .ssh/config file. It would be helpful if ssh can execute local command for individual host prior to its connection attempt.


the unix philosophy is "do one thing and do it well". the shell is the traditional place to handle glue problems like this. e.g., if only one of your servers needs to be fwknop'd first, something like this:

#!/bin/sh
test "$1" == sekrit.server && fwknop ...
/usr/bin/ssh $*

fill in the server and the fwknop params, name it "ssh", and put it somewhere ahead of /usr/bin in your PATH.
--
Aaron Davies
aaron.davies@xxxxxxxxx



Relevant Pages

  • Re: Trouble with X11 over SSH on Mandriva 2010.0
    ... If next clean install/update causes ssh to break, ... installed the sshd daemon/service package (OpenSSH Server) on the server. ... correct values for client and server. ...
    (comp.os.linux.networking)
  • Re: Apache Software Foundation Server compromised, resecured. (fwd)
    ... this was one "result" of the comromised ssh binary at sourceforge. ... a public server of the Apache Software Foundation ... > (ASF) was illegally accessed by unknown crackers. ... > exhaustive audit of all Apache source code and binary distributions ...
    (FreeBSD-Security)
  • Re: FreeBSD Crash without Errors, Warnings, or Panics
    ... I suppose I could run on stable until the driver is fixed in a release branch, but I need this box up and online, and I've always read that the stable branch is not the place for production servers. ... I'm running 6.0-RELEASE-p5 on a Toshiba built server: dual Xeon Intel motherboard with a LSILogic MegaRAID controller. ... Also, some network ports still respond, like a telnet to port 22 to test SSH will yield an SSH banner, but trying to connect with SSH just hangs. ... The box runs a web-based app and connects to a local Postgres DB which seemed to be unable to start new connections being requested by the PHP scripts. ...
    (freebsd-hackers)
  • Re: restrict ssh access
    ... > We have one ssh server which receives about 6000 failed attempts to ... > unsuccessful login attempts per client IP address? ... the remote server is also running OpenSSH. ...
    (comp.security.ssh)
  • Re: SSH as root
    ... Subject: SSH as root ... but it doesn't require having a key on the server that could be ... If they compromise a server, and the passphrase, etc. is there, they only ... private key to anyone. ...
    (SSH)