/ {curly brackets ftw}

This commit is contained in:
fro
2025-10-28 14:56:28 -05:00
parent 116a6c21b8
commit 0c83d88ffa
3 changed files with 13 additions and 11 deletions

View File

@@ -12,7 +12,7 @@ fi
this_file_name=`basename "$0"`
if [ $# -ne 1 ]; then
echo usage: $this_file_name [USERNAME]
echo usage: ${this_file_name} [USERNAME]
exit 1
fi
@@ -21,8 +21,8 @@ username=$1
# ---
# create a new non-root user
# ---
adduser --disabled-password --gecos "" $username
mkdir /home/$username/.ssh
cp /root/.ssh/authorized_keys /home/$username/.ssh/
chown $username:$username /home/$username/.ssh/
chown $username:$username /home/$username/.ssh/authorized_keys
adduser --disabled-password --gecos "" ${username}
mkdir /home/${username}/.ssh
cp /root/.ssh/authorized_keys /home/${username}/.ssh/
chown ${username}:${username} /home/${username}/.ssh/
chown ${username}:${username} /home/${username}/.ssh/authorized_keys