Use. SSH. Keys.
Re:Use Touch ID for Sudo on Mac
by antonio-ramadas on Tuesday March 02, 2021 @03:29PM
(#26320188)
Yes, that is my recommendation as well. It is too late to add that to my comment now, but it is worth mentioning what I said should be a last resource solution.
Coupled with `expect` I use it to authenticate through SSH (that is the only feasible option I got to connect to hosts I’ve got limited access). I even wrote about it: https://antonio-ramadas.github.io/blog/2020/10/30/ssh-login-...
Here is the gist of it:
Edit: Please remove all permissions from the password file with: I’m also assuming you run this script on an environment you control and trust. Be wary of your password.