Step 1. Create custom permission
cleos set account permission YOURACCOUNT claim CLAIM_PUBLIC_KEY active -p YOURACCOUNT@active
Step 2. Link action to permission
cleos set action permission YOURACCOUNT eosio claimrewards claim -p YOURACCOUNT@active
Claiming the rewards
cleos system claimrewards YOURACCOUNT -p YOURACCOUNT@claim
Removing the permission
cleos set account permission YOURACCOUNT claim NULL active -p YOURACCOUNT@active
cleos set action permission YOURACCOUNT eosio claimrewards NULL -p YOURACCOUNT@active