Created
March 11, 2025 20:01
-
-
Save JSouthGB/d4e8895fd7c0a8e0160d201da8726c9f to your computer and use it in GitHub Desktop.
Using sudo over ssh
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
#!/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