On Mon, Jul 31, 2006 at 10:31:45AM -0700, Chris de Vidal wrote:
> I am using the Banner option in my sshd_config, but some scripts see the banner and interpret it
> as an error.


So... uh... don't do that?

> How can I -- on the client side -- silence the banner? I don't want to silence the banner for
> everyone, I just want to silence it on the client for a few scripts.


grep -v comes to mind.

Or, you could run a separate instance of sshd on another port, with no
banner enabled, and have your scripts connect to the alternative port.

> I currently am doing this:
> if ssh user@server command > good_output 2> errors.txt
> then
> email "Command successful."
> else
> email "Problem."
> email errors.txt
> fi
>
> But that traps the SSH banner and I always get "Problem" even when the command was successful.


You're checking the exit status of the ssh process. You're not checking
the output of the command. So your last sentence makes no sense.

If your code had actually read:

ssh user@server command > good_output 2> errors.txt
if [ -s errors.txt ]; then
email "Command successful."
else
email "Problem"
email errors.txt
fi

*then* your last sentence would have made sense. But it doesn't.