FYI: when you login with e.g. putty, you are running as user openhabian. OH runs the exec commands with opnhab. Has security reason. However if you want to test your commands when you are e.g. logged in with openhabian in putty, simply put in front of you command to test sudo -u openhab COMMAND