Last active
October 19, 2022 10:21
-
-
Save goffinet/f515fb4c87f510d74165780cec78d62c to your computer and use it in GitHub Desktop.
Ubuntu/Kali serial console enabled by grub /etc/default/grub, "grub-mkconfig -o /boot/grub/grub.cfg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Works with Kali latest releases | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
cat << EOF > /etc/default/grub | |
# grub-mkconfig -o /boot/grub/grub.cfg | |
GRUB_DEFAULT=0 | |
GRUB_TIMEOUT=5 | |
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` | |
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0,115200" | |
GRUB_CMDLINE_LINUX="initrd=/install/initrd.gz net.ifnames=0 biosdevname=0" | |
GRUB_TERMINAL="console serial" | |
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" | |
EOF | |
grub-mkconfig -o /boot/grub/grub.cfg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Works with Kali latest releases | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
cat << EOF > /etc/default/grub | |
# grub-mkconfig -o /boot/grub/grub.cfg | |
GRUB_DEFAULT=0 | |
GRUB_TIMEOUT=5 | |
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` | |
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0,115200" | |
GRUB_CMDLINE_LINUX="initrd=/install/initrd.gz net.ifnames=0 biosdevname=0" | |
GRUB_TERMINAL="console serial" | |
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" | |
EOF | |
grub-mkconfig -o /boot/grub/grub.cfg | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment