Fix SSH login issue for installed system

- Ensure root password is properly set and not expired in installed system
- Add passwd -u root to unlock account if needed
- Add chage -d 99999 root to remove password expiration
- Create SSH config allowing root login with password
- Fix ensures SSH access works immediately after installation
parent ee3dff24
# SSH configuration for installed system
# Allow root login with password
PermitRootLogin yes
# Standard SSH settings
PubkeyAuthentication yes
PasswordAuthentication yes
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
\ No newline at end of file
......@@ -545,6 +545,11 @@ configure_target_system() {
if [ -n "$ROOT_PASS" ]; then
print_status "Setting root password for installed system..."
echo "root:$ROOT_PASS" | chroot "$TARGET_MOUNT" chpasswd
# Ensure password is not expired and account is unlocked
print_status "Ensuring root account is active and password is not expired..."
chroot "$TARGET_MOUNT" passwd -u root 2>/dev/null || true # Unlock account
chroot "$TARGET_MOUNT" chage -d 99999 root 2>/dev/null || true # Remove expiration
fi
# Set timezone
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment