- Add 
pbcopy.plistto your~/Library/LaunchAgents/folder. - Launch the listener with 
launchctl load ~/Library/LaunchAgents/pbcopy.plist. - Add 
RemoteForward 2224 127.0.0.1:2224in your~/.ssh/configfile under yourHost *or specific hosts sections. - Add 
[ -n "$SSH_CLIENT" ] && alias pbcopy="nc localhost 2224"to your remote~/.bash_profileor other shell profile. - Enjoy 
pbcopyremotely! 
- 
      
 - 
        
Save listochkin/d95aca42c4a6e02222c3afa51b53396f to your computer and use it in GitHub Desktop.  
    pbcopy over SSH
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>localhost.pbcopy</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/bin/pbcopy</string> | |
| </array> | |
| <key>inetdCompatibility</key> | |
| <dict> | |
| <key>Wait</key> | |
| <false/> | |
| </dict> | |
| <key>Sockets</key> | |
| <dict> | |
| <key>Listeners</key> | |
| <dict> | |
| <key>SockServiceName</key> | |
| <string>2224</string> | |
| <key>SockNodeName</key> | |
| <string>127.0.0.1</string> | |
| </dict> | |
| </dict> | |
| </dict> | |
| </plist> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment