When I ssh to another host hosta
and then connect yet to a further host hostb
, everything works fine. Both hosts currently expect a passwd.
However, when I try to shortcut this intermediate host and put the next ssh as a parameter, I get the often mentioned error:
$ ssh -X hosta ssh1 -X -1 login@hostb
Pseudo-terminal will not be allocated because stdin is not a terminal.
ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Permission denied.
All this seems to be related to the environment variables that are passed further on.
What is ssh here expecting? How can I fix this?
And, I have already added hostb to the known hosts on hosta.
According to
man ssh
:Since you are running multiple ssh sessions you would use multiple
-t
's. They can be shortened by doingssh -tt
. The command then would look like the following to force a pseudo-tty so you can enter passwords and see prompts on your connections.Hope this helps!
Kind-of-a-solution:
Instead of executing the remote command directly, I added a
xterm -e
in front. In this manner it seems the right variables are here, and also the second prompt works.