Skip to content

Commit

Permalink
merge_config UPDATE emphasize creating auth users
Browse files Browse the repository at this point in the history
  • Loading branch information
roman committed Nov 2, 2023
1 parent 9bf0f70 commit ceaad4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/merge_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ if [ -f "$AUTHORIZED_KEYS_FILE" ]; then
</inline-definition>
</public-keys>"

echo "Added user \"${CURRENT_USER}\" that can authenticate with a key pair from his authorized_keys to the server configuration..."
echo "--"
echo "-- Added user \"${CURRENT_USER}\" that can authenticate with a key pair from his authorized_keys to the server configuration..."
echo "--"
else
# authorized_keys doesn't exist, get the user's pw hash from /etc/shadow and use that for authentication
CURRENT_USER_PW_HASH=$(awk -v user="$CURRENT_USER" -F':' '$1 == user {print $2}' /etc/shadow)
AUTH_CONFIG="<password>${CURRENT_USER_PW_HASH}</password>"

echo "Added user \"${CURRENT_USER}\" that can authenticate with his password to the server configuration..."
echo "--"
echo "-- Added user \"${CURRENT_USER}\" that can authenticate with his password to the server configuration..."
echo "--"
fi

# import default config
Expand Down

0 comments on commit ceaad4d

Please sign in to comment.