jamesrwhite / minicron

🕰️ Monitor your cron jobs
GNU General Public License v3.0
2.34k stars 154 forks source link

Not able to run any job on remote client #277

Closed dhimanpuneet closed 6 years ago

dhimanpuneet commented 7 years ago

Hey, I am able to add remote client and able to create job with web ui but not able to run any job on remote client . i have installed minicron on remote client also but have database only on server side please help me out in this and tell me all the steps that i have to follow to run the job,thanks in advance

PerRommetveit commented 6 years ago

As a hint, if you on the remote system create a particular user, then restrict logins to only run a single command, see example: https://blog.farville.com/using-command-in-authorized_keys-to-restrict-shell-like-gitolite/

You could then call the remote command from a local bash script on the minicron server:

RES=$(ssh -o StrictHostKeyChecking=no -o ConnectTimeout=15 cronhelper@myserver.com)

You could then parse $RES as you see fit.

Giving full access to the remote site via minicron is not smart, as that means anyone gaining access to minicron, will be able to run anything on the remote server with same privilegies as the existing minicron scripts. By restricting a helper user to only run a single script without arguments, then it's much safer.