From 84c023783f91634bb192f5422a112708f923d3e9 Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 6 Dec 2024 20:58:44 -0500 Subject: [PATCH] it was the newline --- scripts/serviceaccount.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scripts/serviceaccount.sh b/scripts/serviceaccount.sh index 03ff2ab..13d8cb1 100644 --- a/scripts/serviceaccount.sh +++ b/scripts/serviceaccount.sh @@ -5,25 +5,15 @@ SUDOER_PSW= function restofscript(){ USERNAMETOADD= PASSWORDTOADD= - echo "hello, $(whoami)" useradd -m -s /bin/bash ${USERNAMETOADD} - echo "user added" echo "${USERNAMETOADD}:${PASSWORDTOADD}" | chpasswd - echo "password updated" loginctl enable-linger ${USERNAMETOADD} - echo "linger enabled" mkdir /home/${USERNAMETOADD}/.ssh - echo "user has .ssh/" touch /home/${USERNAMETOADD}/authorized_keys - echo "user has .ssh/authorized keys" cat ssh.pub >> /home/${USERNAMETOADD}/.ssh/authorized_keys - echo "authorized keys should accept ssh.pub" chmod 600 /home/${USERNAMETOADD}/authorized_keys - echo "authorized keys should be mode 600" chown -R "${USERNAMETOADD}:${USERNAMETOADD}" /home/${USERNAMETOADD}/.ssh - echo "correct user should own his .ssh directory. done!" } echo "${SUDOER_PSW}" | sudo -S bash -c "$(declare -f restofscript); restofscript" -echo "restofscript should be done, exiting." exit