I've got a script which needs to do something on a remote system using SSH. Something of this sort:
#!/bin/bash
ssh -tt $@ sudo ash -c 'echo "8.8.8.8 dns.google.com" >> /etc/hosts'
If the user doesn't need to enter a password for sudo to work, this is fine. But I can't figure out how to allow the user running this script to enter the password for sudo. Ideas? The remote shell is busybox's ash
.