Skip to content

Commit

Permalink
Merge pull request #29 from fredleb/fredleb-root_password_login
Browse files Browse the repository at this point in the history
Re-enable root login via password
  • Loading branch information
Andrei-Pozolotin authored Feb 14, 2020
2 parents cac4552 + e3df681 commit bb06937
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions initrd-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ do_secret_clean() {
done
}

# re-enable root login via password for initramfs only
do_root_login_enable() {
run_command sed -i -r -e 's/(^root:)!(.*)/\1\2/' $BUILDROOT/etc/shadow
}

# ensure dropbear server host keys
do_dropbear_keys() {

Expand Down
4 changes: 4 additions & 0 deletions initrd-shell.service
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ InitrdPath=/etc/shadow replace=yes
InitrdBuild=/etc/systemd/system/initrd-build.sh command=do_root_shell
InitrdBuild=/etc/systemd/system/initrd-build.sh command=do_secret_clean

# enable root password login (dropbear only. Remove -s from ExecStart in
# initrd-dropbear.service too)
#InitrdBuild=/etc/systemd/system/initrd-build.sh command=do_root_login_enable

# include ssh credentials
InitrdPath=/root/.ssh/authorized_keys source=/root/.ssh/authorized_keys mode=600

Expand Down

0 comments on commit bb06937

Please sign in to comment.