Skip to content

Instantly share code, notes, and snippets.

@JSouthGB
Created March 11, 2025 20:01
Show Gist options
  • Save JSouthGB/d4e8895fd7c0a8e0160d201da8726c9f to your computer and use it in GitHub Desktop.
Save JSouthGB/d4e8895fd7c0a8e0160d201da8726c9f to your computer and use it in GitHub Desktop.
Using sudo over ssh
#!/usr/bin/env bash
# This was needed due to a stale NFS mount on a server which had no BMC
# Install `sshpass`
sudo pacman -S sshpass
# Terminal command
sshpass -p 'YOUR_PASSWORD' ssh USERNAME@IP_ADDRESS 'echo YOUR_PASSWORD | sudo -S umount -f -l /path/to/mount'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment