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

carl at bl.echidna.id.au carl at bl.echidna.id.au
Fri Dec 8 08:44:28 EST 2000


> From: Damien Miller <djm at mindrot.org>
> To: james at nurealm.net
> Cc: openssh-unix-dev at mindrot.org
> 
> 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.

Which is why any shell rc should check, if you have it set up to 
do silly things like that :)

Example for csh :

if ($?USER == 0 || $?prompt == 0) exit








More information about the openssh-unix-dev mailing list