add running-services and ssh_harden

This commit is contained in:
Heretic
2025-05-29 15:25:40 -05:00
committed by GitHub
parent 70c09a782a
commit ced065bbcf
2 changed files with 133 additions and 0 deletions

20
linux/running-services.sh Normal file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
# Description: Basic Pretty Systemctl Services Status Script
# Author: Victor Bishop (Heretic) | https://github.com/Heretic312/devsecops-wrappers
# Date: 12/12/2025
# List all systemctl services and color them based on their status
systemctl list-unit-files | awk '
/enabled/ {print "\033[32m" $0 "\033[0m"; next} # Green for enabled
/disabled/ {print "\033[31m" $0 "\033[0m"; next} # Red for disabled
/static/ {print "\033[34m" $0 "\033[0m"; next} # Blue for static
/alias/ {print "\033[35m" $0 "\033[0m"; next} # Purple for alias
{print $0} # Default output for other lines
'
# List all systemctl services and color the whole line for enabled services
#systemctl list-unit-files | awk '/enabled/ {print "\033[32m" $0 "\033[0m"; next} {print $0}'
# List all running systemctl services and highlight enabled ones with color
#systemctl list-unit-files | grep --color=auto 'enabled'