First check what is your path when ssh'ing to NAS:
ssh remotehost 'echo $PATH'
Then on the NAS check where is unison
installed:
which unison
Most probably it will not be in the ssh
path.
Solutions
If the above described was the problem you can one of the following:
Specify full path: ssh remotehost /full/path/unison
Extend path: ssh remotehost 'PATH="$PATH:/full/path" ; unison'
Set the path in ssh
if PermitUserEnvironment
is enabled in sshd
configuration. Add the PATH
to: ~/.ssh/environment
Execute the command inside a login shell on the NAS: ssh remotehost 'ash -l -c "unison"'