+12
-13
@@ -24,24 +24,23 @@ make -j"$(nproc)"
|
||||
sudo mkdir -p "$PREFIX/sbin" "$INSTANCE_DIR/logbooks/demo"
|
||||
sudo cp elogd "$PREFIX/sbin/"
|
||||
|
||||
# =======================
|
||||
# 3. Générer le hash SHA256-crypt trimmed
|
||||
# =======================
|
||||
sudo apt update
|
||||
sudo apt install -y make gcc git curl openssl python3-pip
|
||||
pip install passlib
|
||||
# Génération en SHA256-crypt complet
|
||||
HASH_FULL=$(mkpasswd -m sha-256 "$PASSWORD")
|
||||
# Exemple: $5$$me1T.2jUUqQNa1wNuey9zNBOmOa4eILOaPb.ZSZjpn4
|
||||
# On coupe après le 3e '$'
|
||||
PASSWORD_HASH=$(python3 - <<EOF
|
||||
sudo apt install -y make gcc git curl openssl python3-full python3-venv
|
||||
|
||||
# =======================
|
||||
# 3. Générer hash EXACT comme ELOG
|
||||
# =======================
|
||||
HASH=$(python3 - <<'EOF'
|
||||
import sys
|
||||
from passlib.hash import sha256_crypt
|
||||
print(sha256_crypt.using(salt='', rounds=5000).hash("$PASSWORD")[4:])
|
||||
password = "testpassword"
|
||||
hashval = sha256_crypt.using(salt='', rounds=5000).hash(password)[4:]
|
||||
print(hashval)
|
||||
EOF
|
||||
)
|
||||
|
||||
echo "[DEBUG] Full hash : $HASH_FULL"
|
||||
echo "[DEBUG] Trimmed : $PASSWORD_HASH"
|
||||
echo "Mot de passe clair : $PASSWORD"
|
||||
echo "Mot de passe encodé : $HASH"
|
||||
|
||||
# =======================
|
||||
# 4. Créer users.xml
|
||||
|
||||
Reference in New Issue
Block a user