• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 822
  • Last Modified:

ssh twice on one command line?

I would like to ssh to our firewall server and then from there ssh to another server all from within the same command line.  Is this possible?

I am using ssh keys, so no passwords are needed if I go first to the firewall and then from the firewall to the other system.

ssh bryan@firewall "ssh bryan@anothersystem"

I've already tried, and it says this:

Pseudo-terminal will not be allocated because stdin is not a terminal.
Killed by signal 2.

I have to press [ctrl]-c to cancel the operation because it doesn't work.
0
bryanlloydharris
Asked:
bryanlloydharris
  • 2
2 Solutions
 
ravenplCommented:
ssh bryan@firewall "ssh -t bryan@anothersystem"
0
 
ygouthamCommented:
hi,

the machine is not hanging.  what you have is only the prompt which has nothing before to prompt you.   the basic shell is missing. if you type a command you would see the output of the command.

try a ls or a pwd to see the results yourself when you are presented with a empty line.  you can always do a CTRL-D to exit gracefully than killing with signal 2.

goutham
0
 
bryanlloydharrisAuthor Commented:
Thanks!
0
 
bryanlloydharrisAuthor Commented:
Just in case someone else comes across this question, I used ssh -t host "ssh -t host2" to get it to work.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now