[rancid] FortiGate login banner

Ni Ne nineoften at hotmail.com
Tue Oct 16 20:21:48 UTC 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20181016/9cdd1e11/attachment.html>


More information about the Rancid-discuss mailing list