?
Solved

ssh twice on one command line?

Posted on 2006-11-09
4
Medium Priority
?
806 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 43

Accepted Solution

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

Assisted Solution

by:ygoutham
ygoutham earned 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

649 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