I am writing a Shell Script where I have to delete a file on a remote machine via a Shell Script.
Flow manually:
ssh [email protected]
.. then at domain:
cd ./some/where
rm some_file.war
How to accomplish that task?
I am writing a Shell Script where I have to delete a file on a remote machine via a Shell Script. Flow manually:
.. then at domain:
How to accomplish that task? |
||||
|
You can pass the
You don't have to The next question is authentication. If you just run that, you will get prompted for a password. If you don't want to enter this interactively you should set up publickey authentication. |
|||||||||||||||||||||
|
The ssh command has a command parameter (last parameter in the command) that you can use to run remote commands. |
|||
|
Setup passwordless keys then add the command as part of the ssh command. See: http://www.dotkam.com/2009/03/10/run-commands-remotely-via-ssh-with-no-password/ |
|||
|
Even better, you could use |
|||||||||||||||||
|