Commit Graph

107 Commits

Author SHA1 Message Date
Clemens Schwaighofer c801ef40b4 Switch from lastlogin to lsogins
Debian 13 dropped lastlogin, replaced with lastlogin2 which is an extra install.
Switch to lslogins, which also makes parsing much easier
v1.2.0
2025-09-12 10:16:05 +09:00
Clemens Schwaighofer 125cb27de8 Remove URLs from ReadMe 2025-03-14 22:28:19 +09:00
Clemens Schwaighofer e45b89c582 AWS Delete user, remove all secondary groups first.
To make sure tha on delete the user is removed from all secondary groups
unset them first before running the userdel command.

-r might not be enought to do that in some situations
v1.1.2
2025-01-06 13:45:51 +09:00
Clemens Schwaighofer 4a8dab7b01 Add base folder for lock user aws script v1.1.1 2024-12-16 15:44:09 +09:00
Clemens Schwaighofer fa47178ed1 Add central logging for all actions done
log file "user_management.log"

Each line is
[YYYY-MM-DD HH:mm:ss] [script name] [TEST] ...

[TEST] is only set if we are in a test run

for create user, if info flag is set, we do not write a log
v1.1.0
2024-12-09 11:37:37 +09:00
Clemens Schwaighofer 4629b58a7e Skip empty group on login check v1.0.3 2024-11-11 17:06:24 +09:00
Clemens Schwaighofer d8cd628ddd Fix for check last login script
the data reading was split with " " (space) which in the while read kept
it as one row, changed the split character to "\n"
v1.0.2
2024-10-24 13:57:04 +09:00
Clemens Schwaighofer 76f9056069 Fix user create with groups
Move the params into array that we add as dynamic parameters to call
v1.0.1
2024-10-11 14:39:56 +09:00
Clemens Schwaighofer 74e7e9823f Bug fix for user create group part 2024-10-11 09:25:41 +09:00
Clemens Schwaighofer 7ce8330aa6 shellcheck fixup v1.0.0 2024-09-27 18:49:36 +09:00
Clemens Schwaighofer d8f9710593 Merge branch 'development' into shellecheck-cleanup 2024-09-24 11:40:13 +09:00
Clemens Schwaighofer c37d17fe9f ReadMe file update 2024-09-24 11:38:45 +09:00
Clemens Schwaighofer 307433e0a7 Merge branch 'development' into shellecheck-cleanup 2024-09-20 09:22:20 +09:00
Clemens Schwaighofer f9cd0806f1 Fix in Readme file for exmaple user_list.txt 2024-09-20 09:22:02 +09:00
Clemens Schwaighofer d9b3fd97fb Merge branch 'development' into shellecheck-cleanup 2024-09-20 09:20:36 +09:00
Clemens Schwaighofer 21177e1762 Updates for ReadMe file for no login shell settings 2024-09-20 09:20:01 +09:00
Clemens Schwaighofer 3aa6de7e23 check last login shellcheck fixes 2024-09-06 14:44:34 +09:00
Clemens Schwaighofer 3c160a62e7 Merge branch 'development' into shellecheck-cleanup 2024-09-06 14:37:37 +09:00
Clemens Schwaighofer ca4616c5ee Text fix for error strings in last login check v0.19.1 2024-09-06 14:36:09 +09:00
Clemens Schwaighofer 251b0bf981 SSH login last date check was wrong 2024-09-06 14:34:38 +09:00
Clemens Schwaighofer 6daccfe57c Check last login update with more days info
if WARN then write WARN instead of OK.
Add day numbers if OK

Some minor shellscript updates
2024-09-06 14:25:28 +09:00
Clemens Schwaighofer 91f096ab0c Merge branch 'master' into shellecheck-cleanup 2024-09-06 10:58:13 +09:00
Clemens Schwaighofer 935d6a84c9 Add login shell type select (bash login or no login), fix ssh base groups
no ssh allow/forward/reject base group was set if an optional sub group was set

Add possibility to chose no login when setting the ssh access type to "...|no_login"
v0.19.0
2024-09-06 10:44:31 +09:00
Clemens Schwaighofer ee7cc8555e Merge branch 'development' into shellecheck-cleanup 2024-09-04 14:05:51 +09:00
Clemens Schwaighofer 83f84abd46 Fix skip naming for zip/move creation v0.18.1 2024-09-04 14:04:25 +09:00
Clemens Schwaighofer 090d6f9cec Download zip file message only if there is a file to download 2024-09-04 13:44:47 +09:00
Clemens Schwaighofer 5659cc010f Update zip file/clean up skip with skip information 2024-09-04 13:43:24 +09:00
Clemens Schwaighofer 0bd40cdd73 Create user: skip zip creation run if there are no PEM files
Avoid "file not found" zip file creation and remove if there are no
PEM files created, eg if we have a pre defined pub file
2024-09-04 13:21:36 +09:00
Clemens Schwaighofer e4ed6fed8d shellcheck based code cleanup 2024-09-04 11:16:05 +09:00
Clemens Schwaighofer 5bf30a8b2f Add shellcheckrc 2024-09-03 12:47:52 +09:00
Clemens Schwaighofer 26c007dba6 Remove error=1 debug set v0.18.0 2024-02-15 18:10:53 +09:00
Clemens Schwaighofer 785e3c116d Fix password set length check 2024-02-15 18:07:53 +09:00
Clemens Schwaighofer adbfeb0074 Password length set, auto set if not set, and set for pwgen actually 2024-02-15 18:05:03 +09:00
Clemens Schwaighofer 8c7ef32894 Create user script update: allow no password, allow different password length 2024-02-15 18:03:16 +09:00
Clemens Schwaighofer 70ef7a3fc5 Check last login mandatory settings now has combined abort
set an error flag and check all settings before exit program
v0.17.10
2024-02-14 14:46:17 +09:00
Clemens Schwaighofer 89252af50b Bug fix for json export with double quotes v0.17.9 2023-12-22 13:39:18 +09:00
Clemens Schwaighofer 8fb833d3c4 Fix the call for getting instance data
Do not use name alias, use the IP address for this
v0.17.8
2023-12-22 13:31:33 +09:00
Clemens Schwaighofer 694f04313c Add Account, Region and Instance info for each report
So we can easy match up user reports to other information we collect
v0.17.7
2023-12-22 11:54:34 +09:00
Clemens Schwaighofer 50e28c7cfd Check that fallback last access file exists v0.17.6 2023-12-21 16:43:57 +09:00
Clemens Schwaighofer 65b7a6ad43 Fix date check for account created date
Use regex to check instead of empty string.
A comment could be set instead of a date
2023-12-21 16:39:05 +09:00
Clemens Schwaighofer 244461d466 sshforward group typo in lock and unlock users v0.17.5 2023-12-21 16:11:31 +09:00
Clemens Schwaighofer 66213dfd65 Text fixes for check last login v0.17.4 2023-12-21 16:06:53 +09:00
Clemens Schwaighofer 39da44b546 Wrong unlock account var used for unlock users v0.17.3 2023-12-21 16:01:35 +09:00
Clemens Schwaighofer d4bb06e3e1 Fix lock user flow to only lock if the user is not in the reject group 2023-12-21 15:58:28 +09:00
Clemens Schwaighofer cc647de495 Readme update 2023-12-21 15:14:57 +09:00
Clemens Schwaighofer 68b450baaf Add warning message for logins v0.17.2 2023-12-21 13:46:58 +09:00
Clemens Schwaighofer 8452a1b8c0 Fix pre check for ssh login checks v0.17.1 2023-12-21 13:35:50 +09:00
Clemens Schwaighofer 3fcb74ac47 Update check last login script with better reporting and csv/json output
Now for each ssh group we report last login/account create stats.
Add the main user group to output
Add unlock user commands for locked users

Add CSV and JSON formatted output
v0.17.0
2023-12-21 13:23:35 +09:00
Clemens Schwaighofer 70212da3cb systemd logs end with dot and we split, so we missed user names with . inside v0.16.4 2023-12-20 17:51:35 +09:00
Clemens Schwaighofer 168cf9db15 Create user output was using wrong var for SSH access type v0.16.3 2023-08-21 09:41:23 +09:00