I'm using Mac machine and I need to connect to remote machine(Linux) and remove the contents of a directory in the remote machine. Tried using
ssh root@server-address rm -rf testdir
ssh root@server-address "rm -rf testdir" #suggest you quote the command
You can work-around the password prompt by the steps mentioned [ here ].