openssh-SNAP-20001207 scp "Bad file descriptor" sort-of work-around

James james at amethyst.nurealm.net
Sat Dec 9 15:11:58 EST 2000


Ok, I'm starting to get a handle.

Damien had asked:

> What does "ssh localhost true" say?

Finally, I went back and cleaned up ~/.ssh/config and
~/.ssh/authorized_keys2.  So now that "ssh localhost" actually works, I get:

 $ ssh localhost true
 Enter passphrase for key '/home/james/.ssh/id_dsa_jkey':
 sourcing /etc/profile...
 Running Linux 2.2.16-3.
 Fri Dec  8 16:36:21 MST 2000
 not a tty
 select: Bad file descriptor

(You can see the output of my "tty" command there.)

Now, I tried using Bash 2.03.8(1)-release from RedHat 6.2 and noted that it
acts the same as Bash 1.14.7(1).  I then downloaded Bash 2.04 and read the
man page.  Very interesting:

INVOCATION
 .
 .
 .

       Bash  attempts  to  determine  when it is being run by the
       remote shell daemon, usually rshd.  If bash determines  it
       is  being run by rshd, it reads and executes commands from
       ~/.bashrc, if that file exists and is readable.   It  will
       not  do  this  if invoked as sh.  The --norc option may be
       used to inhibit this behavior, and the --rcfile option may
       be  used  to  force another file to be read, but rshd does
       not generally invoke the shell with those options or allow
       them to be specified.

Ugh!  I'd think bash should read different startup files when invoked by a
remote shell daemon and when invoked as a non interactive shell.

Is sending random text to a remote shell daemon really such a bad thing that
ssh and scp couldn't be made to simply pass through the text?

Again, please Cc me on any response, as I'm not subscribed to the list.

Thanks.


James Feeney






More information about the openssh-unix-dev mailing list