Install
- Add
pbcopy.plist
to your~/Library/LaunchAgents/
folder. - Launch the listener with
launchctl load ~/Library/LaunchAgents/pbcopy.plist
. - Add
RemoteForward 2224 127.0.0.1:2224
in your~/.ssh/config
file under yourHost *
or specific hosts sections. - Add
[ -n "$SSH_CLIENT" ] && alias pbcopy="nc localhost 2224"
to your remote~/.bash_profile
or other shell profile. - Enjoy
pbcopy
remotely!
Thanks. This worked on my ssh session to OSX. I've been searching for a solution for a very long time. https://apple.stackexchange.com/questions/267366/cfpasteboardref-cfpasteboardcreatecfallocatorref-cfstringref-failed-to-cre