Added authorized_keys file for SSH connections
This commit is contained in:
parent
91f7628081
commit
6cdf2a4211
2 changed files with 3 additions and 1 deletions
1
.linux_items/authorized_keys
Normal file
1
.linux_items/authorized_keys
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
#Put SSH keys here
|
||||||
|
|
@ -229,7 +229,8 @@ function update_live_env() {
|
||||||
ssh-keygen -b 4096 -C "$username@$hostname" -N "" -f "$SKEL_DIR/.ssh/id_rsa"
|
ssh-keygen -b 4096 -C "$username@$hostname" -N "" -f "$SKEL_DIR/.ssh/id_rsa"
|
||||||
echo 'rm /root/.ssh/id*' >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
echo 'rm /root/.ssh/id*' >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
||||||
echo 'rm /root/.zlogin' >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
echo 'rm /root/.zlogin' >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
||||||
sed -i -r 's/^(.*PermitRootLogin.*)$/#NOPE#\1/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
sed -i -r 's/^(.*PermitRootLogin.*)$/PermitRootLogin no/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
||||||
|
cp "$ROOT_DIR/.linux_items/authorized_keys" "$SKEL_DIR/.ssh/authorized_keys"
|
||||||
|
|
||||||
# Root user
|
# Root user
|
||||||
echo "echo 'root:$ROOT_PASSWORD' | chpasswd" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
echo "echo 'root:$ROOT_PASSWORD' | chpasswd" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue