From 9658cf7c095a85add437d0437c0fbd6c672f8603 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 11 Nov 2024 11:44:33 +0100 Subject: [PATCH] Add user nd-admin.. --- add_new_user.sh | 39 ++++++++++++------- .../nd-admin/.ssh/authorized_keys | 3 ++ 2 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 supported-files/user_templates/nd-admin/.ssh/authorized_keys diff --git a/add_new_user.sh b/add_new_user.sh index 4647427..af23192 100755 --- a/add_new_user.sh +++ b/add_new_user.sh @@ -20,26 +20,27 @@ templates_base_dir="${working_dir}/supported-files/user_templates" templates_all_dir="${templates_base_dir}/all" sudo_users=" - sysadm - localadmin - chris - erik - wadmin - ilker - ilker-sudo - ckubu alex alis - defa - init - marcus - xmatti c3po - jason - hedwig - jumpy + chris + ckubu + defa dolphin eris + erik + hedwig + ilker + ilker-sudo + init + jason + jumpy + localadmin + marcus + nd-admin + sysadm + wadmin + xmatti " @@ -171,6 +172,9 @@ if ! id -u "${user_name}" > /dev/null 2>&1 ; then user_uid=1042 user_gid=1042 home_dir="/var/www/nd-web-demo" + elif [[ "$user_name" = 'nd-admin' ]]; then + user_uid=1045 + user_gid=1045 elif [[ "$user_name" = 'sysadm' ]]; then user_uid=1050 user_gid=1050 @@ -237,6 +241,11 @@ if $password_needed ; then if [[ "$user_name" = 'webadmin' ]]; then perl -i -n -p -e "s#^(${user_name}):[^:]+:(.+)#\1:\\\$6\\\$P1UvKv/0\\\$0hWHiUXQTrNl5SFf52iAY1qDYsJFhjHaVC6F6BuvazcNXkzjAcnuX5PMml5DLh4tyFpqVdPpCyAyd92YypNbu/:\2#" /etc/shadow + # - nd-admin + # - + elif [[ "$user_name" = 'nd-admin' ]]; then + perl -i -n -p -e "s#^(${user_name}):[^:]+:(.+)#\1:\\\$y\\\$j9T\\\$1YJwHY0qdLimgtdOKlTxR1\\\$/O9QWTpr0Y41TduR2GZ0FMCiIxFqOaXWSM9hmHRnv80:\2#" /etc/shadow + # - nd-web-prod # - elif [[ "$user_name" = 'nd-web-prod' ]]; then diff --git a/supported-files/user_templates/nd-admin/.ssh/authorized_keys b/supported-files/user_templates/nd-admin/.ssh/authorized_keys new file mode 100644 index 0000000..d08b0cd --- /dev/null +++ b/supported-files/user_templates/nd-admin/.ssh/authorized_keys @@ -0,0 +1,3 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO90culn3sicU2chTHn40ytcTay0nUIHap0uF/5fVM6P chris@sol +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOQHMUKlDh2ufno5pZOhUY5xFljC1R5zQ/GjOHDkS58D root@sol +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKTjd4XFBdF/V9VdSZjy9G7nupBwaMqsrtQSP4Uctkrz org@rdsgn.de