Running command from SSH tunnel before logging in…

Hypothetically this is used for scripting, say you want to run a command on another server you can run it using a [ssh -t].

This usually requires RSA keys to remove the need to enter passwords but beware, it is best to use a limited account as using the root account is frowned at when logging into ssh servers.

http://unixhelp.ed.ac.uk/CGI/man-cgi?ssh+1

ssh:

-t Force pseudo-tty allocation. This can be used to execute arbi-
trary screen-based programs on a remote machine, which can be
very useful, e.g., when implementing menu services. Multiple -t
options force tty allocation, even if ssh has no local tty.

ssh -t user@host ‘command to run when ssh is completely logged in’

Cheers,

Leave a Reply