Skip to content

Commit fe199a5

Browse files
committed
permit logins as root
1 parent 0205f68 commit fe199a5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

makefiles/in_chroot/install.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ if ! [ -d /home/$USERNAME ]; then
3939
rm -f /home/$USERNAME/.bashrc
4040
fi
4141

42+
# also set the same password for root
43+
echo "root:$PASS" | chpasswd
44+
4245
# add empty ~/.ssh/authorized_keys (see #80)
4346
function add_authorized_keys_file() {
4447
SSH_AUTHORIZED_KEYS=/home/$1/.ssh/authorized_keys
@@ -56,8 +59,8 @@ add_authorized_keys_file "root"
5659
userdel -r -f alarm || true
5760

5861
# configure ssh
59-
grep 'PermitRootLogin' /etc/ssh/sshd_config && sed -i 's/^.*PermitRootLogin.*$/PermitRootLogin without-password/' /etc/ssh/sshd_config
60-
grep 'PermitRootLogin' /etc/ssh/sshd_config || echo "PermitRootLogin without-password" >> /etc/ssh/sshd_config
62+
grep 'PermitRootLogin' /etc/ssh/sshd_config && sed -i 's/^.*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
63+
grep 'PermitRootLogin' /etc/ssh/sshd_config || echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
6164
grep -x 'X11Forwarding yes' /etc/ssh/sshd_config || echo "X11Forwarding yes" >> /etc/ssh/sshd_config
6265

6366
# build all the tools

0 commit comments

Comments
 (0)