[rancid] FortiGate login banner

Ni Ne <[email protected]>
Newsgroups gmane.network.rancid
Message-ID <BYAPR04MB4230EC8A34E6F9A1B26303D7B5FE0@BYAPR04MB4230.namprd04.prod.outlook.com>
If you configure a login banner to FortiGates, you have to accept it before you can login to the device. This pops up after entering the password, and you are prompted with:

$banner-message
(Press 'a' to accept):

I successfully tested these small changes to fnlogin (version 3.8, build 3763) to automatically accept the login banner. The lines between the hash-marks were added to the fnlogin script.

-----------------------

    -re "@\[^\r\n]+\[Pp]assword:"   {
                      # ssh pwd prompt
                      sleep 1
                      send -- "$userpswd\r"
                      exp_continue
                    }
    -re "$p_prompt"         {
                      sleep 1;
                      if {$uprompt_seen == 1} {
                        send -- "$userpswd\r"
                      } else {
                        send -- "$passwd\r"
                      }
                      exp_continue
                    }
    ### accept banner
    "(Press 'a' to accept):" {
                    send "a\r"
                    exp_continue
                    }
    ### accept banner /end
    -- "$prompt"            { break; }
     }
    }
    set in_proc 0
    return 0
}

-----------------------

Regards,

-Aaron

_______________________________________________
Rancid-discuss mailing list
[email protected]
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.