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

Damien Miller djm at mindrot.org
Fri Dec 8 08:40:13 EST 2000


On Thu, 7 Dec 2000, James wrote:

> Damien wrote:
> 
> > Do you have something in your profile or shell rc which causes text to
> > be displayed on non-interactive logins?
> 
> No, but there's part of where the problem is. scp seems to read
> /etc/passwd on the _target_ server machine (as well as on the client
> machine) to determine the user's default shell on that target
> machine, and then invokes a non-login _interactive_ shell, NOT a
> non-interactive shell.
>
> I know this from changing the various scripts and the /etc/passwd
> login shell for the user (root). Where man bash has
>
> My ~/.bashrc normally starts with "source /etc/profile", which
> was what actually generated the text, 

This is your problem here: profile should only be read for interactive sessions - the shell does this automatically for you, you should not
source it in bashrc.

Your shell initialisation for non-interactive sessions must not produce
any output. This requirement isn't unique to scp, all the tools layered
on top of rsh have it too.

-d

-- 
| ``We've all heard that a million monkeys banging on | Damien Miller -
| a million typewriters will eventually reproduce the | <djm at mindrot.org>
| works of Shakespeare. Now, thanks to the Internet, / 
| we know this is not true.'' - Robert Wilensky UCB / http://www.mindrot.org







More information about the openssh-unix-dev mailing list