aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Zhou <dzhou@redhat.com>2023-07-03 11:00:25 -0400
committerJake Hunsaker <jacob.r.hunsaker@gmail.com>2023-07-07 16:27:48 -0400
commit24b650731e1a0b5f51938ee51cd6dd7a448f8ca7 (patch)
treed5feffb9dad9738dd638b3564b35cb9394383dfd
parentfc1489a621108d3613d3337489a64950e52d77c3 (diff)
downloadsos-24b650731e1a0b5f51938ee51cd6dd7a448f8ca7.tar.gz
[ssh] Add User .ssh Config File Option
Resolves issue SUPDEV-137. Adds a plugin option for the ssh module, defining whether it will or will not collect .ssh config files per user Default for new option is True Signed-off-by: Daniel Zhou <dzhou@redhat.com>
-rw-r--r--sos/report/plugins/ssh.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/sos/report/plugins/ssh.py b/sos/report/plugins/ssh.py
index 0fe5dd4e..67a02290 100644
--- a/sos/report/plugins/ssh.py
+++ b/sos/report/plugins/ssh.py
@@ -8,7 +8,7 @@
#
# See the LICENSE file in the source distribution for further information.
-from sos.report.plugins import Plugin, IndependentPlugin
+from sos.report.plugins import Plugin, IndependentPlugin, PluginOpt
class Ssh(Plugin, IndependentPlugin):
@@ -18,6 +18,12 @@ class Ssh(Plugin, IndependentPlugin):
plugin_name = 'ssh'
profiles = ('services', 'security', 'system', 'identity')
+ option_list = [
+ PluginOpt('userconfs', default=True, val_type=str,
+ desc=('Changes whether module will '
+ 'collect user .ssh configs'))
+ ]
+
def setup(self):
self.add_file_tags({
@@ -34,7 +40,10 @@ class Ssh(Plugin, IndependentPlugin):
self.add_copy_spec(sshcfgs)
self.included_configs(sshcfgs)
- self.user_ssh_files_permissions()
+
+ # If userconfs option is set to False, skips this
+ if self.get_option('userconfs'):
+ self.user_ssh_files_permissions()
def included_configs(self, sshcfgs):
# Read configs for any includes and copy those