Solved

ssh twice on one command line?

Posted on 2006-11-09
4
760 Views
Last Modified: 2013-12-16
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
Comment
Question by:bryanlloydharris
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
ravenpl earned 450 total points
ID: 17912373
ssh bryan@firewall "ssh -t bryan@anothersystem"
0
 
LVL 14

Assisted Solution

by:ygoutham
ygoutham earned 50 total points
ID: 17912533
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
 
LVL 3

Author Comment

by:bryanlloydharris
ID: 17914877
Thanks!
0
 
LVL 3

Author Comment

by:bryanlloydharris
ID: 17914887
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question