Libssh configuration files

This module provides the ssh options in libssh configuration file

Parsers provided by this module are:

LibsshClientConfig - file /etc/libssh/libssh_client.config

LibsshServerConfig - file /etc/libssh/libssh_server.config

class insights.parsers.libssh_config.LibsshClientConfig(context, extra_bad_lines=None)[source]

Bases: LibsshConfig

Parser for accessing the /etc/libssh/libssh_client.config file.

Note

Please refer to the super-class insights.parsers.libssh_config:LibsshConfig for more usage information.

class insights.parsers.libssh_config.LibsshConfig(context, extra_bad_lines=None)[source]

Bases: CommandParser, dict

Base class for libssh configuration file.

There are many options in the libssh configuration file and all of them are stored in one of the following formations: a) Key [space] Value b) Key = Value

There are the keywords used in the configuration file:

include hostkey listenaddress port loglevel ciphers macs kexalgorithms match pubkeyacceptedkeytypes hostkeyalgorithms all user group host localaddress localport rdomain address

Sample output:

# Parse system-wide crypto configuration file
Include /etc/crypto-policies/back-ends/libssh.config
# Parse OpenSSH configuration file for consistency
Include /etc/ssh/sshd_config

Note

If there are two or more lines that have the same key, then we store the values in a list.

Examples

>>> 'Include' in config
True
>>> config['Include']
['/etc/crypto-policies/back-ends/libssh.config', '/etc/ssh/sshd_config']
Raises:

SkipComponent -- When input content is empty or there is a syntax error.

parse_content(content)[source]

This method must be implemented by classes based on this class.

class insights.parsers.libssh_config.LibsshServerConfig(context, extra_bad_lines=None)[source]

Bases: LibsshConfig

Parser for accessing the /etc/libssh/libssh_server.config file

Note

Please refer to the super-class insights.parsers.libssh_config:LibsshConfig for more usage information.