1833875 Members
2586 Online
110063 Solutions
New Discussion

remove remote command

 

remove remote command

Hi all,
please, there would be a command or script that allows me to remove files remotely?

Best regards,

Christian
Christian Aguilar
4 REPLIES 4
Bharat Katkar
Honored Contributor

Re: remove remote command

Hi,
You will have to configure .rhosts or /etc/hosts.equiv file to get permission on remote server.
Have a look at man .rhosts and man hosts.equiv.
You can set either of them.

If you are not bothered about security then just edit /.rhosts file and add "+ +" to it on both the servers and then you can fire command as:

# remsh hostname


Regards,
You need to know a lot to actually know how little you know
Pete Randall
Outstanding Contributor

Re: remove remote command

You could use remsh or rexec, assuming you have /etc/hosts.equiv or .rhosts set up. Do a man on rexec.


Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: remove remote command

Assuming that you have permissions on the remote system, remsh host rm /xxx/yyy/zzz will work. Ftp can also be used. If the files are NFS mounted then rm itself will do the trick. Again, all of these are limited by the permissions that you have on the remote box.
If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: remove remote command

This could also be done via SSH.

# ssh somehost "rm /dir/somefile"