|
Secure Shell
can sshclient execute a local command ? Jul 21 2009 04:59PM J. Bakshi (bakshi12 gmail com) (2 replies) Re: can sshclient execute a local command ? Jul 23 2009 10:53PM "Peter Valdemar Mørch (Lists)" (4ux6as402 sneakemail com) (1 replies) Re: [SOLVED] can sshclient execute a local command ? Jul 24 2009 03:19PM J. Bakshi (bakshi12 gmail com) |
|
Privacy Statement |
> Hello list,
>
> I have openssh-client __1:5.1p1-5+b1 installed in my debian box. I have
> remote ssh information stored in my .ssh/config file. I have protected one
> remote ssh by fwknop. When I need ssh login to that particular sever I have
> to open the port with fwknop client installed in my local box. Is there any
> option in sshclient so that It can execute a local command ( here the
> fwknop obviously ) before doing ssh to that remote server ?
>
> Thanks
You can do something like that defining some alias on /etc/bashrc
alias ssh="function dossh { fwknop -A \"tcp/22\" -s -D \$1; /usr/bin/ssh -l
myuser \$1; }; dossh "
Then: ssh myhost
Moreover... for more complex expresion... you can add the user parameter as
$2, add if's if you want, or even use the $@ and extract the hostname from the
parameters to use it on fwknop and use the rest of the argument on -A and ssh
command.
--
Ing. Aaron G. Mizrachi P.
http://www.unmanarc.com
Mobil 1: + 58 416-6143543
Mobil 2: + 58 424-2412503
BBPIN: 0x 247066C1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
iEYEABECAAYFAkpmqkIACgkQ2ixydRu83wCthwCgtXpkd+S3wgIh8V66IS1pNHPp
DHoAoKhsihcVhC98xLjZAB6EFxkSHv6c
=11Dq
-----END PGP SIGNATURE-----
[ reply ]