SOLVED FreeNAS 11.1-U6 Cron not working, permission denied

Status
Not open for further replies.

learnsomemore

Dabbler
Joined
Aug 16, 2018
Messages
11
I created a script and it works from the terminal but when trying it in GUI via "Run Now", it get error permission denied. I did the following setup:

  1. Created bash script
  2. ssh into FreeNAS as root and then su <USER>.
  3. Ran script with ./scriptname
  4. See the script ran successfully (script does a rsync and outputs success and error msg to a file)
  5. Next I went to FreeNAS GUI > Tasks > Cron Jobs
  6. User: = <USER>
  7. Command: absolute path to script (/mnt/vol1/<directory>/<filename>)
  8. Redirect Stdout and Stderr are not checked

FreeNAS 11.1-U6
Directory uses windows permissions

Error when running script from FreeNAS GUI:
Code:
freenas cronjob: /bin/sh: /mnt/vol1/Directory1/User1/rsync_cron_script: Permission denied


if i change <USER> to root, i no longer get permission denied but the script fails because it's not being run as the correct user with ssh key.


Does <USER> need some other special permission for this to work from FreeNAS GUI?
 
Last edited:

learnsomemore

Dabbler
Joined
Aug 16, 2018
Messages
11
What was the solution?

I was hoping someone here would help with that.

"if i change <USER> to root, i no longer get permission denied but the script fails because it's not being run as the correct user with ssh key."

I left <USER> as root and added roots ssh pub to the other systems authorized keys.
 
Status
Not open for further replies.
Top