Skip to content

Commit 9ba8baf

Browse files
committed
Fix ssh
1 parent 9056086 commit 9ba8baf

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

scripts/build-initrd.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,32 @@ chmod 700 /root/.ssh
106106
107107
# Set root password (can be overridden in config)
108108
# POC ONLY
109+
echo "init: setting root password" > /dev/kmsg
109110
echo "root:root" | chpasswd
110111
111112
# Generate host keys if they don't exist
113+
echo "init: generating SSH host keys" > /dev/kmsg
112114
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
113115
ssh-keygen -A
114116
fi
115117
118+
# Configure SSH to allow root password login (POC only - not for production!)
119+
echo "init: configuring SSH for root password login" > /dev/kmsg
120+
cat >> /etc/ssh/sshd_config <<'SSHEOF'
121+
122+
# POC Configuration - Allow root login with password
123+
PermitRootLogin yes
124+
PasswordAuthentication yes
125+
SSHEOF
126+
116127
# Start SSH daemon
128+
echo "init: starting sshd daemon" > /dev/kmsg
117129
/usr/sbin/sshd
118-
119-
echo "init: SSH server started" > /dev/kmsg
130+
if [ $? -eq 0 ]; then
131+
echo "init: SSH server started successfully on port 22" > /dev/kmsg
132+
else
133+
echo "init: ERROR - SSH server failed to start!" > /dev/kmsg
134+
fi
120135
echo "init: launching entrypoint from ${WORKDIR:-/}" > /dev/kmsg
121136
echo "init: entrypoint=${ENTRYPOINT} cmd=${CMD}" > /dev/kmsg
122137

0 commit comments

Comments
 (0)