I frequently need to ssh into a server, but I can't ssh into it directly while I'm connected to our VPN. Thus, I have to ssh into another server and ssh into it from there. Is there any way that I can write a script and/or shell function for this? I've tried this, buit it gave me an error:
% ssh jason@server2 'ssh jason@server1'
jason@server2's password:
Pseudo-terminal will not be allocated because stdin is not a terminal.
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-with-mic,password).
(and of course the username and server name have been changed)