Skip to content

Instantly share code, notes, and snippets.

@khast3x
Created August 9, 2017 19:54
Show Gist options
  • Select an option

  • Save khast3x/65c8dd83575a4565b5fe554aff1330a0 to your computer and use it in GitHub Desktop.

Select an option

Save khast3x/65c8dd83575a4565b5fe554aff1330a0 to your computer and use it in GitHub Desktop.
[Kali VM] start gui or not on boot. Can also set ssh on startup
#/bin/bash
echo "== START OR STOP GUI FOR KALI VM =="
echo ""
echo "ssh $USER@$HOSTNAME"
echo ""
echo ""
if [[ $1 = "start" ]];
then systemctl set-default graphical.target;echo "Starting GUI at reboot"
elif [[ $1 = "stop" ]];
then systemctl set-default multi-user.target;echo "Stopping GUI at reboot"
elif [[ $1 = "ssh" ]];
then echo "Adding SSH on boot -- AUTHORIZED KEY REQUIRED";systemctl enable ssh
else
echo "Choose $0 [start|stop|ssh]"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment