Skip to content

Commit 0686d74

Browse files
committed
fdi.ssh=1 enables root login & passwd auth
1 parent 4d3987a commit 0686d74

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

root/etc/rc.d/rc.local

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,18 @@ fi
1616

1717
# enable ssh
1818
if [ "$KCL_FDI_SSH" == "1" ]; then
19+
KEYS=("PubkeyAuthentication" "PasswordAuthentication" "PermitRootLogin")
20+
21+
for KEY in "${KEYS[@]}"; do
22+
sed -i "/^#\?${KEY}/d" "/etc/ssh/sshd_config"
23+
done
24+
25+
{
26+
echo '#FDI'
27+
echo "PubkeyAuthentication yes"
28+
echo "PasswordAuthentication yes"
29+
echo "PermitRootLogin yes"
30+
} >> "/etc/ssh/sshd_config"
31+
1932
systemctl start sshd
2033
fi

0 commit comments

Comments
 (0)