Skip to content

Commit

Permalink
Fix sed statement for the changes in sshd_config over the years.
Browse files Browse the repository at this point in the history
Now 'root' can actually login using a password. Really fixes debian-pi#516.
  • Loading branch information
diederikdehaas committed Jan 10, 2020
1 parent 7bf3cd8 commit e586a73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/etc/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,8 @@ if [ ! "$disable_root" = "1" ]; then
root_pw_ssh_hack_needed=$(is_change_in_release "2014-03-28" "$release")
if [ "$root_pw_ssh_hack_needed" = "1" ] && [ -f /rootfs/etc/ssh/sshd_config ] ; then
echo -n " Allowing root to login with password on $release... "
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /rootfs/etc/ssh/sshd_config || fail
sed -i -E 's/PermitRootLogin (without|prohibit)-password/PermitRootLogin yes/' /rootfs/etc/ssh/sshd_config || fail
sed -i 's/^#PermitRootLogin/PermitRootLogin/' /rootfs/etc/ssh/sshd_config || fail
echo "OK"
fi
echo -n " Setting root password... "
Expand Down

0 comments on commit e586a73

Please sign in to comment.