Skip to content

Commit

Permalink
permit logins as root
Browse files Browse the repository at this point in the history
  • Loading branch information
anuejn committed Apr 11, 2024
1 parent ad568b5 commit 2adee8d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions makefiles/in_chroot/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ if ! [ -d /home/$USERNAME ]; then
rm -f /home/$USERNAME/.bashrc
fi

# also set the same password for root
echo "root:$PASS" | chpasswd

# add empty ~/.ssh/authorized_keys (see #80)
function add_authorized_keys_file() {
SSH_AUTHORIZED_KEYS=/home/$1/.ssh/authorized_keys
Expand All @@ -56,8 +59,8 @@ add_authorized_keys_file "root"
userdel -r -f alarm || true

# configure ssh
grep 'PermitRootLogin' /etc/ssh/sshd_config && sed -i 's/^.*PermitRootLogin.*$/PermitRootLogin without-password/' /etc/ssh/sshd_config
grep 'PermitRootLogin' /etc/ssh/sshd_config || echo "PermitRootLogin without-password" >> /etc/ssh/sshd_config
grep 'PermitRootLogin' /etc/ssh/sshd_config && sed -i 's/^.*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
grep 'PermitRootLogin' /etc/ssh/sshd_config || echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
grep -x 'X11Forwarding yes' /etc/ssh/sshd_config || echo "X11Forwarding yes" >> /etc/ssh/sshd_config

# build all the tools
Expand Down

0 comments on commit 2adee8d

Please sign in to comment.