Re: SSH through another computer



"Masatran, R. Deepak" <masatran@xxxxxxxxxxxxxxxxxxx> writes:

I am forced to SSH to host1, and SSH from there to host2.

How can I do this in a single command?

I have a private key in localhost, which is accepted for SSH by host2. How
can I use this key in host2 without storing it in host1?

May be something like (untested):

$ ssh -N -L 20022:host2:22 host1
$ ssh -p 20022 localhost

The first command create a tunnel from localhost:22022 to host2 port 22

The second connects ssh to host2 through the tunnel.

HTH

--
Dominique Dumont
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: Unix accounts at Universities
    ... > Another Q I have is that when I try to ssh to another ... > but the prompt indicates that I am in the same host... ... do you get logged into host2 or not? ... I'm a bit surprised by the %-sign prompt. ...
    (comp.security.unix)
  • Re: SSH through another computer
    ... I have a private key in localhost, which is accepted for SSH by host2. ... sorry for sending directly Masatran... ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Problem with SSH on Solaris 9
    ... > On my own account, I want to create an authorized_keys file. ... HOST1 (you run ssh on this one to connect to HOST2): ... Now you will be able to log into HOST2 from HOST1 without a password. ...
    (comp.security.ssh)
  • SSH through another computer
    ... I am forced to SSH to host1, and SSH from there to host2. ... I have a private key in localhost, which is accepted for SSH by host2. ...
    (Debian-User)
  • Re: SSH through another computer
    ... I have a private key in localhost, which is accepted for SSH by host2. ... It is not necessary to have your private key for host2 stored on host1 ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)