amt - to be precise the cgi script makes the connection as the user that your cgi process runs as (ok, usually at least with apache, httpd's user), so you'd have to set up that whole ssh deal
first on each remote machine to accept the connection.
Although you can do that, as
fglock mentions you're better off with a dedicated user, and also, there are other issues that open up when trying to do this from a cgi involving file/dir permissions and security ..
..usually it's done with sudo, to manage a dedicated remote user's ability to do operations in privileged areas..
if you get it working you'll be juggling with several balls in the air at once!