Compare commits
3 Commits
v1.1.0
...
125cb27de8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
125cb27de8 | ||
|
|
e45b89c582 | ||
|
|
4a8dab7b01 |
@@ -11,14 +11,11 @@ The folder holding the script must be owned by *root* and have *600* permissions
|
||||
|
||||
```sh
|
||||
cd /root/
|
||||
git clone http://gitlab-ap.factory.tools/scripts-collections/aws-user-create.git users
|
||||
git clone <UrlToGitRepository> users
|
||||
chown root. users
|
||||
chgrp 600 users
|
||||
```
|
||||
|
||||
Alternate download:
|
||||
`git clone https://git.tequila.jp/ScriptsCollections/AwsUserCreate.git users`
|
||||
|
||||
## Folders
|
||||
|
||||
Inside the base folder there are
|
||||
|
||||
@@ -164,9 +164,13 @@ for username in "$@"; do
|
||||
|
||||
echo "[1] Remove user + home dir";
|
||||
if [ ${TEST} -eq 0 ]; then
|
||||
userdel -r "${username}"
|
||||
# remove all secondary group entries first before we delete the user
|
||||
# there might be cases where they are left
|
||||
usermod -G "" "${username}";
|
||||
userdel -r "${username}";
|
||||
else
|
||||
echo "$> userdel -r ${username}";
|
||||
echo "$> usermod -G \"\" \"${username}\"";
|
||||
echo "$> userdel -r \"${username}\"";
|
||||
fi;
|
||||
|
||||
# remove ssh files in pub
|
||||
|
||||
@@ -46,6 +46,8 @@ ssh_allow_group="sshallow";
|
||||
ssh_forward_group="sshforward";
|
||||
user_group_tpl="gpasswd -d %s %s\ngpasswd -a %s %s\n";
|
||||
|
||||
# base folder for all data
|
||||
BASE_FOLDER=$(dirname "$(readlink -f "$0")")"/";
|
||||
LOG="${BASE_FOLDER}/../log/user_management.log";
|
||||
function write_log()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user