Trapping banner displayed by sshd during ssh / scp?

From: Kevin Pease (kevin.pease_at_fmr.com)
Date: 10/27/03

  • Next message: Richard Brandt: "Re: Can't get ssh and wu-ftpd to work together"
    Date: Mon, 27 Oct 2003 09:59:30 -0500
    
    

        Hi everyone,

        I'm hoping someone can help me with this annoyance that I'm having with
    ssh & scp. I've written a small program which does the following:
        1) uses ssh (with rsa authentication, no password needed) to execute
    two commands on a remote system.
        2) scp's a dozen-or-so files to a remote system
        3) uses ssh (rsa authentication again) to execute another two commands
    on the remote system.

        I'm running it through cron, and I'm having difficulty figuring out how
    to trap the login banner displayed by the remote system's sshd. The other
    output of my program is being sent to me via email, and I'd like to discard
    the banner (because it appears a bunch of times, and it's useless,
    repetitive information for the purposes of my program). Essentially, I get
    two emails:
        One from the cron daemon on my local system containing the un-trapped
    output from my program:

        ****************************************
        * Remote System Banner *
        ****************************************
        repeated numerous times

        The other email contains actual information I want.

        Now, I know that you can configure the sshd on the remote system to turn
    off display of that banner, but I've been told by my system admins that this
    is against corporate policy, since it contains a legal notice indicating,
    essentially, "if you aren't authorized to be here, you're toast." Is there
    some _other_ way of trapping this output? Or do I need to set up a mail
    filter and redirect these emails to /dev/null?

        Operating environment is open ssh (server + client), on Solaris 8 (both
    systems), and the program I'm using to do this is a very simple korn shell
    script;

        Any thoughts or help would be greatly appreciated.

        Thanks,

        Kevin Pease


  • Next message: Richard Brandt: "Re: Can't get ssh and wu-ftpd to work together"

    Relevant Pages

    • Re: exit status of remote commands
      ... I want to execute some commands on a remote machine through ssh and ...
      (comp.lang.perl.misc)
    • Re: Commands via SSH
      ... > I have found a ton of articles describing how to execute commands ... If you're using SSH with public keys then you should switch ... background processes and have them continue running on a remote host ...
      (Fedora)
    • Re: exit status of remote commands
      ... I want to execute some commands on a remote machine through ssh and ...
      (comp.lang.perl.misc)
    • Re: ssh and many command line
      ... > I try to execute many command on a remote system through ssh but some of those commands fails. ... What is THE way to execute many commands through ssh? ...
      (Debian-User)
    • Re: Python script for remotely shutting down Windows PC from Linux ?
      ... Now, when I run this script, it successfully logs me into the windows ... Because you execute both commands locally. ... ssh opens a connection to the ...
      (comp.lang.python)