Re: How to do an rm through ssh



Wences wrote:

Hello, everybody.

The problem is that this line fails:

ssh -i /root/.ssh/some_user-identity -p XXX some_user@xxxxxxxxxxxxxxx
-s \
"rm -fr /cygdrive/d/backup/$day_of_week/*"

( $day_of_week is 1_Monday, 2_Tuesday, etc, and those directories exist
)
The error message says:

Request for subsystem 'rm -fr /cygdrive/d/backup/4_Thursday/*' failed
on channel 0

What's the meaning of that?

Hello

With -s you are requesting that ssh starts subsystem "your command and path"
and it fails, maybe you can find out exact reason from server log. I have
only used sftp subsystem and I don't know much about those.

But anyway, there is no need for -s when you wan't to execute commands, just
use:

ssh -options some_user@host "command"

Does this help?

BR
Kimmo Koivisto
.