scp not tolerant of extraneous shell messages

Carson Gaspar carson at taltos.org
Tue Jul 2 08:30:56 EST 2002


--On Monday, July 01, 2002 7:04 PM +0100 Darren Evans 
<darren at horseplay.demon.co.uk> wrote:

> A workaround for sftp is to comment out fortune from the shell
> startup script allowed sftp to work, presumably too much information,
> may be useful to know of other circumstances for FAQ.

The (or at least a) correct way to do this is to wrap the offending 
commands in a test for tty-ness. In a POSIX shell:

if [ -t 1 ]; # Is fd 1 a tty?
	echo "I have a tty! Whee!"
	fortune
fi

-- 
Carson




More information about the openssh-unix-dev mailing list