Open popeyelau opened 11 months ago
$ ssh-copy-id -i ~/.ssh/id_rsa.pub MacStudio
$ vim ~/.ssh/config
Host MacStudio HostName 192.168.xx.xx User Popeye Port 22 ProxyCommand nc -v -x 127.0.0.1:8889 %h %p LocalForward 6900 localhost:5900 ControlPath ~/.ssh/MacStudio.ctl
- 设置别名
```shell
# 连接
alias ssh-up='ssh -fNTM MacStudio'
# 状态
alias ssh-status='ssh -TO check MacStudio'
# 退出
alias ssh-down='ssh -TO exit MacStudio'
Reference
-f
Run in the background before command execution.
-N
Don’t execute any commands
-T
Disable pseudo-tty allocation. I don’t know what this means.
-S socketname
Use a control socket with name socketname
-M
Put control socket in master mode
-O check, exit
Control command
$ ssh-up
$ open 'vnc://localhost:6900'
创建 plist
$ vim /Library/LaunchDaemons/com.popeye.frpc.plist
<?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>frpc</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/frpc</string>
<string>-c</string>
<string>/Users/popeye/frp/frpc.ini</string>
</array>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
校验 plist 语法
$ plutil /Library/LaunchDaemons/frpc.plist
修改权限
$ chmod 644 /Library/LaunchDaemons/com.popeye.frpc.plist
添加/移除自启动
$ launchctl load | unload /Library/LaunchDaemons/com.popeye.frpc.plist
启动/停止
$ launchctl start | stop frpc
$ defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/remote-management/