ssh me@host1 'ssh me@host2'
If I want to execute the "who" command on the host "monkey" then I can simply do this.
Code:
ssh bob@monkey 'who' Code:
ssh bob@monkey 'ssh bob@donkey' My passwords on monkey and donkey are different. It did not even ask me to enter my password for the host "donkey". |
Hello,
Can I ask why you would want to do this? Cheers, Josh |
Once I am logged on monkey, from there I frequently need to logon to several other hosts like donkey.
So ssh + password + password + exitcan be faster than ssh + password + ssh + password + exit + exitbesides, the actual hostnames and options are quite long so a simple script called donkey donkey + password + password + exitwould be efficient and faster, for me. |
Maybe you could write a script that would pass the passwords to the ssh commands, and use arguments for whatever commands that you need to be ran?
|
Hi,
I do believe that the lack of a (pseudo)terminal is the reason why the initial command doesn't work. Give this a try: Code:
ssh -t bob@monkey 'ssh bob@donkey' Hope this helps. |
Quote:
Thank you. |
You're welcome :)
|
Ahh, I forgot about that. Thanks for that.... I haven't used linux in a bit because my laptop died....
|
All times are GMT -5. The time now is 10:28 PM. |