<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
$banner-message</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
(Press 'a' to accept):<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-----------------------</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span> -re "@\[^\r\n]+\[Pp]assword:" {<br>
</span>
<div> # ssh pwd prompt<br>
</div>
<div> sleep 1<br>
</div>
<div> send -- "$userpswd\r"<br>
</div>
<div> exp_continue<br>
</div>
<div> }<br>
</div>
<div> -re "$p_prompt" {<br>
</div>
<div> sleep 1;<br>
</div>
<div> if {$uprompt_seen == 1} {<br>
</div>
<div> send -- "$userpswd\r"<br>
</div>
<div> } else {<br>
</div>
<div> send -- "$passwd\r"<br>
</div>
<div> }<br>
</div>
<div> exp_continue<br>
</div>
<div> }<br>
</div>
<div> ### accept banner<br>
</div>
<div> "(Press 'a' to accept):" {<br>
</div>
<div> send "a\r"<br>
</div>
<div> exp_continue<br>
</div>
<div> }<br>
</div>
<div> ### accept banner /end<br>
</div>
<div> -- "$prompt" { break; }<br>
</div>
<div> }<br>
</div>
<div> }<br>
</div>
<div> set in_proc 0<br>
</div>
<div> return 0<br>
</div>
<span>}</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><span style=" font-size: 16px; background-color: rgb(255, 255, 255); display: inline !important">-----------------------</span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><span style=" font-size: 16px; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><span style=" font-size: 16px; background-color: rgb(255, 255, 255); display: inline !important">Regards,</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><span style=" font-size: 16px; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><span style=" font-size: 16px; background-color: rgb(255, 255, 255); display: inline !important">-Aaron</span></span></div>
</body>
</html>