From 0702feb22b2b635f6bf46c031335c7936008f1d2 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 7 Nov 2024 17:20:03 +0100 Subject: [PATCH] add_new_user.sh: add users 'nd-web-prod' and 'nd-web-demo'. --- add_new_user.sh | 18 ++++++++++++++++++ .../nd-web-demo/.ssh/authorized_keys | 4 ++++ .../nd-web-prod/.ssh/authorized_keys | 4 ++++ 3 files changed, 26 insertions(+) create mode 100644 supported-files/user_templates/nd-web-demo/.ssh/authorized_keys create mode 100644 supported-files/user_templates/nd-web-prod/.ssh/authorized_keys diff --git a/add_new_user.sh b/add_new_user.sh index c9de062..4647427 100755 --- a/add_new_user.sh +++ b/add_new_user.sh @@ -163,6 +163,14 @@ if ! id -u "${user_name}" > /dev/null 2>&1 ; then user_uid=1040 user_gid=1040 home_dir="/var/www" + elif [[ "$user_name" = 'nd-web-prod' ]]; then + user_uid=1041 + user_gid=1041 + home_dir="/var/www/nd-web-prod" + elif [[ "$user_name" = 'nd-web-demo' ]]; then + user_uid=1042 + user_gid=1042 + home_dir="/var/www/nd-web-demo" elif [[ "$user_name" = 'sysadm' ]]; then user_uid=1050 user_gid=1050 @@ -229,6 +237,16 @@ 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-web-prod + # - + elif [[ "$user_name" = 'nd-web-prod' ]]; then + perl -i -n -p -e "s#^(${user_name}):[^:]+:(.+)#\1:\\\$y\\\$j9T\\\$boxWdtKmOp7AKHEAFj1.1/\\\$jlhYI62N5u6P.jRxAgmmDGVvGnfrPKTcKelYC3Z2sM4:\2#" /etc/shadow + + # - nd-web-demo + # - + elif [[ "$user_name" = 'nd-web-demo' ]]; then + perl -i -n -p -e "s#^(${user_name}):[^:]+:(.+)#\1:\\\$y\\\$j9T\\\$uqzyF.BYEZrgJlDnGTH/x/\\\$abn3RCkx5SAz.f9B5Iqvaw/LWRncoyS40Lx2uGj2xQ.:\2#" /etc/shadow + # - sysadm # - elif [[ "$user_name" = 'sysadm' ]]; then diff --git a/supported-files/user_templates/nd-web-demo/.ssh/authorized_keys b/supported-files/user_templates/nd-web-demo/.ssh/authorized_keys new file mode 100644 index 0000000..5d9cec4 --- /dev/null +++ b/supported-files/user_templates/nd-web-demo/.ssh/authorized_keys @@ -0,0 +1,4 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO90culn3sicU2chTHn40ytcTay0nUIHap0uF/5fVM6P chris@sol +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOQHMUKlDh2ufno5pZOhUY5xFljC1R5zQ/GjOHDkS58D root@sol +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKTjd4XFBdF/V9VdSZjy9G7nupBwaMqsrtQSP4Uctkrz org@rdsgn.de +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMClTmBQGPp1FFKA3n+ANJ9XuEYfR/ALXcoBVclV3eVP datenlieferung@nd-online.de diff --git a/supported-files/user_templates/nd-web-prod/.ssh/authorized_keys b/supported-files/user_templates/nd-web-prod/.ssh/authorized_keys new file mode 100644 index 0000000..1580b00 --- /dev/null +++ b/supported-files/user_templates/nd-web-prod/.ssh/authorized_keys @@ -0,0 +1,4 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO90culn3sicU2chTHn40ytcTay0nUIHap0uF/5fVM6P chris@sol +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOQHMUKlDh2ufno5pZOhUY5xFljC1R5zQ/GjOHDkS58D root@sol +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKTjd4XFBdF/V9VdSZjy9G7nupBwaMqsrtQSP4Uctkrz org@rdsgn.de +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJA+YbWWoJpn6w5wsyzy3/g91nyesWoHGw9+eFdB3V9p datenlieferung@nd-online.de