commit 716d901ef3b9c7b0fee16a1c98171b6624403527 parent 29857e9c584b957de3eb76c4cae87840aa7f8eda Author: pyratebeard <root@pyratebeard.net> Date: Thu, 5 Aug 2021 10:46:32 +0100 updates so script can be run as alternative user Diffstat:
M | ssh_keys/script | | | 10 | +++++++--- |
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ssh_keys/script b/ssh_keys/script @@ -1,4 +1,8 @@ #!/bin/sh -[ -d $HOME/.ssh/ ] || mkdir $HOME/.ssh -mv ./authorized_keys $HOME/.ssh/authorized_keys -chmod 600 $HOME/.ssh/authorized_keys + +USERNAME="pyratebeard" + +[ -d /home/${USERNAME}/.ssh/ ] || mkdir /home/${USERNAME}/.ssh +mv ./authorized_keys /home/${USERNAME}/.ssh/authorized_keys +chmod 600 /home/${USERNAME}/.ssh/authorized_keys +chown -R ${USERNAME}:users /home/${USERNAME}/.ssh