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
It prompts me for the password in the terminal. Is there any way through which I can delete the contents of directory without having to manually enter the password for the remote machine? I want to do this using shell script. As I'm new to shell, any help would be appreciated.
ssh root@server-address "rm -rf testdir" #suggest you quote the command
looks fine.
You can work-around the password prompt by the steps mentioned [ here ].
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With