Changing Synology default SSH $PATH

‹ Progress Bar Project Management | Nobody expects a velociraptor for breakfast ›

By default, my Synology DiskStation NAS gives non-interactive shells a path of:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/syno/bin

/opt/bin is not included so rsync, git and other programs installed with ipkg don't work.

One way to add /opt/bin to the default path to fix git and rsync is:

  1. Edit /etc/ssh/sshd_config and enable: PermitUserEnvironment yes
  2. Create a $HOME/.ssh/environment with this line: PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/syno/bin:/opt/bin:/opt/sbin
  3. Log into the web console (the sshd upstart script doesn't seem to restart sshd fully) disable the ssh service, then re-enable it
Subscribe to All Posts - Wesley Tanaka