I have a script which runs another script via SSH on a remote server using sudo. However, when I type the password, it shows up on the terminal. (Otherwise it works fine)>
The best way is ssh -t user@server "sudo ", for example ssh -t user@server "sudo reboot".
It will prompt for password for user first and then root(since we are running the script or command with root privilege.