↖️ Show all posts

Connect with ssh and fire a sudo command 🚀

You need the t option. That’s all there is. Nothing else. Source on StackOverflow

$ ssh -t user@server "sudo script"


$ ssh -At user@server "sudo script"

from man ssh

Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

⬅️ Read previous Read next ➡️