This script resets all USB ports by unbinding and re-binding the host controller interface.
Make this shell script executable first. Then call it with sudo:
sudo ./usb_kernel_reset.sh
I've copied this from askubuntu.com: https://askubuntu.com/a/61165/1125701 .
I'm uploading it here for my future self. If it helps you too, go ahead and upvote that answer.