On my NAS I have installed Unison package, which works when ssh'd into the NAS with this $NAS unison -version.

However when running the command locally without ssh'ing to the system first using ssh remotehost unison -version I get this error returned.

ash: unison: not found
  • Are you ssh'ing into your NAS with the same account as the local console? Have you installed unison into a directory that is not in your search path? Oct 28, 2013 at 6:23

1 Answer 1


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.


If the above described was the problem you can one of the following:

  1. Specify full path: ssh remotehost /full/path/unison

  2. Extend path: ssh remotehost 'PATH="$PATH:/full/path" ; unison'

  3. Set the path in ssh if PermitUserEnvironment is enabled in sshd configuration. Add the PATH to: ~/.ssh/environment

  4. Execute the command inside a login shell on the NAS: ssh remotehost 'ash -l -c "unison"'

  • The full path needed to be specified, created a symbolic link to rectify.
    – Imran
    Oct 28, 2013 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.