Dup Ver Goto 📝

SshUserEnvironment

PT2/aw/os/macos does not exist
To
14 lines, 58 words, 535 chars Page 'SshUserEnvironment' does not exist.

By default, the sshd on macos uses a restricted environment. If you want to set your own PATH, you need to define e.g.

PATH=/Users/me/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin

and then you need to edit /private/etc/ssh/sshd_config and change the following line

PermitUserEnvironment yes

and then restart sshd via

sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist