4

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.

0

2 Answers 2

3
+200

According to man ssh:

 -t      Force pseudo-terminal allocation.  This can be used to execute
         arbitrary screen-based programs on a remote machine, which can be
         very useful, e.g. when implementing menu services.  Multiple -t
         options force tty allocation, even if ssh has no local tty.

Since you are running multiple ssh sessions you would use multiple -t's. They can be shortened by doing ssh -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.

ssh -tt -X hosta ssh1 -X -1 login@hostb

Hope this helps!

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .