I am trying to set up an ssh proxycommand, where the user name at the final host is different from the user name at the original host. I am logged in on firstHost as username and want to effectively run this command:

ssh middle ssh othername@target

I would like to be able to do this with

ssh target

This post suggests using a proxycommand that does an ssh to target to run nc on target. That makes the connection, but does not use the passwordless ssh that I set up. Is there a way to get this to work with passwordless ssh? (And is there a reason to use nc instead of making the proxy command ssh middle ssh othername@target?)

So if you followed that post, and it works aside from the authentication, it sure would be nice if you posted the exact config you used and the output of ssh -vv target so we can see the error messages. The examples suggested by that answer should work just fine, and is nearly identical to my working configs. I could answer the why Proxycommand part, but I figure the main part of your question is about the authentication networking in the multi-hop setup.
–
ZoredacheNov 14 '12 at 1:58

Check superuser.com/a/484979/163736 for an example on how to use an SSH tunnel. You will have to adjust your local SSH config regarding the server (to instead connect to a given localhost port), but as the server is not directly accessible anyways, that shouldn't be a problem.
–
ClaudiusNov 14 '12 at 18:07