LIGISTX
Guru
- Joined
- Apr 12, 2015
- Messages
- 525
So, I am really at a loss. I just upgraded from 11 to 11.1 and am on 11.1U4. A script I had working before and a friend has working on 9.x doesn't seem to work. Weird thing is, it works if I jexec into the jail and run it. Its a simple mirror script, I have it looking at a remote volume and mirror it to a mounted volume within the jail. If I run the script from within the jail it executes without issue. Also, its not the fault of the rsa key itself, I can ssh into the remote host via freenas shell and jexec jail shell. It will authenticate in those instances, but if I run a script from freenas itself I get:
I am at a loss as to why this is happening. My jail can see my rsa key, seemingly user permissions are correct as it can successfully run the script from within the jail and can ssh into the remote host, its just like the rsa key isn't getting used when the script is ran from outside of the jail which to me makes no real sense.
Any advice would be appreciated. I am not sure if this is a 11.1 issue, or if I am just doing something incorrectly. Although, this is running on a 9.x install and was running on my 11.0 install just last week.
The script is:
Code:
mirror: Login failed: Login incorrect
I am at a loss as to why this is happening. My jail can see my rsa key, seemingly user permissions are correct as it can successfully run the script from within the jail and can ssh into the remote host, its just like the rsa key isn't getting used when the script is ran from outside of the jail which to me makes no real sense.
Any advice would be appreciated. I am not sure if this is a 11.1 issue, or if I am just doing something incorrectly. Although, this is running on a 9.x install and was running on my 11.0 install just last week.
The script is:
Code:
#!/usr/local/bin/bash -l login="alpha" pass="beta" host="gamma@delta.epsilon" remote_dir="/zeta/eta" local_dir="/theta/iota/" volume="/theta/iota/" cmd="$cmd mirror -c -p --use-pget-n=5 -P5 --no-empty-dirs ${remote_dir} ${local_dir} -x \"(^|/)\.\" -x \"_gsdata_\"" trap "rm -f /tmp/lockfile.lock" SIGINT SIGTERM if [[ -e /tmp/lockfile.lock ]] then echo "Sync is running already." exit 1 else # echo "Creating lock ..." touch /tmp/lockfile.lock /usr/local/bin/lftp -u $login,$pass sftp://${host} << EOF set sftp:auto-confirm no set sftp:connect-program 'ssh -a -x -i /mnt/root/.ssh/id_rsa' set xfer:log-file "/root/logfile.log" $cmd quit EOF # echo "Sync EOF excuting..." rm -f /tmp/lockfile.lock trap - SIGINT SIGTERM exit 0 fi