7. Create test.sh according to the original post: echo "/data/.ssh/ssh -vvv -F /data/.ssh/ssh_config user@laptop 'ls > /home/user/ls.txt'" > test.sh
8. Make test.sh executable: chmod 755 test.sh
9. Run test.sh on the command line and verify that it connects. The -vvv gives extra verbose logging to assist with any problems.
10. Success!
Here is the contents of my /data/.ssh directory. I would be interested in seeing the same from chicho so I can work out the permissions that are needed. Obviously all mine are root, so I will need to use root in Tasker.
DIRECTORY:
root@localhost:.ssh # ls -al /data | grep .ssh
drwxr-x--- root shell 2014-01-04 01:12 .ssh
FILES:
root@localhost:.ssh # ls -al
-rw------- root root 1675 2014-01-04 01:14 id_rsa
-rw-r--r-- root root 400 2014-01-04 01:14 id_rsa.pub
-rw-r--r-- root root 173 2014-01-04 00:41 known_hosts
-rwxr-xr-x root root 3287144 2014-01-04 00:40 ssh
-rwxr-xr-x root root 2845148 2014-01-04 01:12 ssh-keygen
-rw-r--r-- root root 117 2014-01-04 00:45 ssh_config
-rwxr-xr-x root root 91 2014-01-04 01:20 test.sh
I created this Run Shell command in Tasker: "sh /data/.ssh/test.sh", selecting Use Root. It successfully created the ls.txt on my laptop. Then on a hunch I just pasted the contents of test.sh into the Run Shell command, and it worked. So apparently I don't need to create the .sh file first. This is good, as it will allow commands to be dynamically generated in Tasker without writing to a .sh file.
I haven't done much further testing, but this verifies the method and fills in the details from start to finish. Thanks to chicho for the original post :)