oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Fortigate fw and admin user (readonly) with different prompt (..$)

Open wieczorr opened this issue 8 years ago • 2 comments

I have a Fortigate100D from which I need to save the configuration. I got a user with limited administrator privileges (read only ). After logging, it has a different prompt "FG0T1_SGNA $ ", than in the case of an administrator with full rights when the prompt finished sign: "# "

"FGT01_SGNA space $ space " When I use different account - super admin ("#") I can save the configuration by oxidized. . What do I need to change in the script fortios.rb to make it work ?

Debbug. W, [2018-10-24T23:50:17.730160 #54455] WARN -- : 10.11.5.1 raised Net::SSH::AuthenticationFailed with msg "Authentication failed for user [email protected]" W, [2018-10-24T23:50:37.731832 #54455] WARN -- : 10.11.5.1 raised Net::OpenTimeout (rescued Timeout::Error) with msg "timed out while opening a connection to the host" W, [2018-10-24T23:50:38.540318 #54455] WARN -- : 10.11.5.1 status no_connection, retry attempt 1 W, [2018-10-24T23:50:38.901766 #54455] WARN -- : 10.11.5.1 raised Net::SSH::AuthenticationFailed with msg "Authentication failed for user [email protected]" W, [2018-10-24T23:50:58.903409 #54455] WARN -- : 10.11.5.1 raised Net::OpenTimeout (rescued Timeout::Error) with msg "timed out while opening a connection to the host" W, [2018-10-24T23:50:59.548110 #54455] WARN -- : 10.11.5.1 status no_connection, retry attempt 2

prompt in fortios.rb script /^([-\w.~]+(\s[(\w-.)]+)?~?\s?[#>$]\s?)/

wieczorr avatar Oct 24 '18 21:10 wieczorr

The prompt in the current version of fortos.rb matches your use case:

irb(main):001:0> "FG0T1_SGNA $ ".match /^([-\w.~]+(\s[(\w\-.)]+)?~?\s?[#>$]\s?)$/
=> #<MatchData "FG0T1_SGNA $ " 1:"FG0T1_SGNA $ " 2:nil>

The debug log you've provided suggests authentication issues (Oxidized is unable to log in as user backup to device 10.11.5.1), not prompt issues.

Verify the correct authentication credentials (username, password, keys...) are available to Oxidized and being effectively provided for this device. You might find debugging helpful.

wk avatar Oct 27 '18 06:10 wk

Many thanks. Bad syntax in the router.db file :(. Now works.

wieczorr avatar Oct 29 '18 10:10 wieczorr