-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,19 @@ autoinstall: | |
USER_HOME="/home/$USERNAME"; | ||
echo "Detected user $USERNAME";' | ||
|
||
# Generate SSH key | ||
- curtin in-target --target=/target -- bash -c ' | ||
USERNAME=$(getent passwd 1000 | cut -d: -f1); | ||
USER_HOME="/home/$USERNAME"; | ||
if [ -d "$USER_HOME" ]; then | ||
sudo -u $USERNAME mkdir -p "$USER_HOME/.ssh"; | ||
sudo -u $USERNAME ssh-keygen -t rsa -b 4096 -C "[email protected]" -f "$USER_HOME/.ssh/id_rsa" -N ""; | ||
sudo -u $USERNAME chmod 700 "$USER_HOME/.ssh"; | ||
sudo -u $USERNAME chmod 600 "$USER_HOME/.ssh/id_rsa"; | ||
sudo -u $USERNAME chmod 644 "$USER_HOME/.ssh/id_rsa.pub"; | ||
echo "SSH key generated for $USERNAME"; | ||
fi' | ||
|
||
- curtin in-target --target=/target -- bash -c ' | ||
echo "Installation paused. Create /tmp/continue to proceed."; | ||
while [ ! -f /tmp/continue ]; do sleep 5; done' |