Solved

ssh twice on one command line?

Posted on 2006-11-09
4
749 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now