Skip to content

Instantly share code, notes, and snippets.

@slowpeek
Last active February 8, 2024 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slowpeek/8dcb1a10846371f820c36b7282897f49 to your computer and use it in GitHub Desktop.
Save slowpeek/8dcb1a10846371f820c36b7282897f49 to your computer and use it in GitHub Desktop.
Make dropbear not start with 'nodropbear' or 'dropbear=no' kernel arg
#!/bin/sh
: <<'README'
Make dropbear not start with 'nodropbear' or 'dropbear=no' kernel arg.
Put this script under /etc/initramfs-tools/scripts/init-top/ and update
initramfs.
README
PREREQ=""
prereqs() {
echo "$PREREQ"
}
case "$1" in
prereqs)
prereqs
exit 0 ;;
esac
# shellcheck disable=SC2013
for arg in $(cat /proc/cmdline); do
case "$arg" in
nodropbear|dropbear=no)
if [ -e /sbin/dropbear ]; then
# There is '[ -x /sbin/dropbear ] || exit 0' early in
# /usr/share/initramfs-tools/scripts/init-premount/dropbear
chmod -x /sbin/dropbear
fi
break ;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment