Skip to content

Instantly share code, notes, and snippets.

@Dowwie
Forked from pjobson/remove_usb_guard.md
Created March 19, 2024 19:54
Show Gist options
  • Save Dowwie/d8db32f5e4d82355cf5b7f64a87470e7 to your computer and use it in GitHub Desktop.
Save Dowwie/d8db32f5e4d82355cf5b7f64a87470e7 to your computer and use it in GitHub Desktop.

Revisions

  1. @pjobson pjobson revised this gist Apr 18, 2019. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions remove_usb_guard.md
    Original file line number Diff line number Diff line change
    @@ -23,5 +23,15 @@ Reboot may hang at stopping usbguard, again, because F you. Power off or wait.

    sudo apt remove usbguard -y
    sudo apt purge usbguard -y

    ## Remove Conf Files

    sudo rm -rf /etc/usbguard/

    ## Reboot

    I had issues until I rebooted for whatever reason.

    sudo reboot

    Now you're free!
  2. @pjobson pjobson revised this gist Apr 18, 2019. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions remove_usb_guard.md
    Original file line number Diff line number Diff line change
    @@ -6,22 +6,22 @@ My kernel is version 4.15.0-47-generic, not sure if this stopped working at some

    ## Regain Access

    sudo echo "allow id *:*" > /etc/usbguard/rules.conf
    sudo sed -i 's/PresentDevicePolicy=apply-policy/PresentDevicePolicy=allow/' /etc/usbguard/usbguard-daemon.conf
    sudo reboot
    sudo echo "allow id *:*" > /etc/usbguard/rules.conf
    sudo sed -i 's/PresentDevicePolicy=apply-policy/PresentDevicePolicy=allow/' /etc/usbguard/usbguard-daemon.conf
    sudo reboot

    Reboot may hang at stopping usbguard, again, because F you. Power off or wait. You'll hopefully have access to your devices when your machine comes back up.

    ## Stop & Disable Services

    sudo systemctl stop usbguard.service
    sudo systemctl disable usbguard.service
    sudo systemctl stop usbguard-dbus.service
    sudo systemctl disable usbguard-dbus.service
    sudo systemctl stop usbguard.service
    sudo systemctl disable usbguard.service
    sudo systemctl stop usbguard-dbus.service
    sudo systemctl disable usbguard-dbus.service

    ## Uninstall and Purge

    sudo apt remove usbguard -y
    sudo apt purge usbguard -y
    sudo apt remove usbguard -y
    sudo apt purge usbguard -y

    Now you're free!
  3. @pjobson pjobson created this gist Apr 18, 2019.
    27 changes: 27 additions & 0 deletions remove_usb_guard.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    # Remove USB Guard From Ubuntu

    If you're a sucker like me and installed usbguard on a Ubuntu variant you may find that you will have access to none of your usb devices at all, because F you. The installer automatically sets up the daemon which has no rules so will just block all of your devices. Doing a basic `apt remove usbguard` may fail at 25%, because also F you.

    My kernel is version 4.15.0-47-generic, not sure if this stopped working at some point or what.

    ## Regain Access

    sudo echo "allow id *:*" > /etc/usbguard/rules.conf
    sudo sed -i 's/PresentDevicePolicy=apply-policy/PresentDevicePolicy=allow/' /etc/usbguard/usbguard-daemon.conf
    sudo reboot

    Reboot may hang at stopping usbguard, again, because F you. Power off or wait. You'll hopefully have access to your devices when your machine comes back up.

    ## Stop & Disable Services

    sudo systemctl stop usbguard.service
    sudo systemctl disable usbguard.service
    sudo systemctl stop usbguard-dbus.service
    sudo systemctl disable usbguard-dbus.service

    ## Uninstall and Purge

    sudo apt remove usbguard -y
    sudo apt purge usbguard -y

    Now you're free!