I posted this last week on the ssh newsgroup with no response. I
apologize to those who read the newsgroup and the list for the
duplication.
I am having problems getting both ssh-1.2.26 and ssh-1.2.27 to work with
an scp between two remote servers. I have tried on a variety of platforms
including aix, solaris, and linux and all fail. They all result in the
following error:
$ scp jmorace@saul:/tmp/foo jmorace@becker:/tmp/foo
You have no controlling tty and no DISPLAY. Cannot read passphrase.
lost connection
This is valid syntax, right? When only specifying one remote server, it
works fine. It also works in X when DISPLAY is set.
It seems to be coming from the following code in readpass.c:
/* Read the passphrase from /dev/tty to make it possible to ask it even
when stdin has been redirected. */
f = fopen("/dev/tty", "r");
if (!f)
{
if (getenv("DISPLAY"))
{
...
return xstrdup(buf);
}
/* No controlling terminal and no DISPLAY. Nowhere to read. */
fprintf(stderr, "You have no controlling tty and no DISPLAY.
Cannot read passphrase.\n");
exit(1);
}
I'm not familiar with the use of /dev/tty, should this work? Does anybody
else have this problem or know how to fix this? I know I can use .shosts
and other ways to get around having to supply a password, but something
seems wrong here. According to the man page "Unlike rcp, scp will ask for
passwords or passphrases if they are needed for authentication." Any
suggestions would be very much appreciated!
Thank you,
Jonathan