Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions root/etc/rc.d/rc.local
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,18 @@ fi

# enable ssh
if [ "$KCL_FDI_SSH" == "1" ]; then
KEYS=("PubkeyAuthentication" "PasswordAuthentication" "PermitRootLogin")

for KEY in "${KEYS[@]}"; do
sed -i "/^#\?${KEY}/d" "/etc/ssh/sshd_config"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sed -i "/^#\?${KEY}/d" "/etc/ssh/sshd_config"
sed -i "/^${KEY}/d" "/etc/ssh/sshd_config"

We don't need to delete comments.

done

{
echo '#FDI'
echo "PubkeyAuthentication yes"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I deploy a key into FDI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL. Thanks

echo "PasswordAuthentication yes"
echo "PermitRootLogin yes"
} >> "/etc/ssh/sshd_config"

systemctl start sshd
fi