- If you just want to ssh without entering your password every time, you can see autossh, sshpass and so on.
- 解压myuri.zip
- 首次使用点击一下myuri.app(因为安全原因,可能需要确认app来源)
- 打开test.html
- 查看applescript代码,可以用脚本编辑器打开myuri.applescript
- js代码查看test.html
- app的配置
- 右击myApp.app显示包内容,有一个
info.list
的文件,用文本编辑器打开它,找到如下内容,这里的myuri
是自定义的
- 右击myApp.app显示包内容,有一个
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>MYURI DEMO</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myuri</string>
</array>
</dict>
</array>
- 其实这个做法确实很不安全,更好的做法可以用免密登录,或者二次开发sshd服务,用token代替密码
- 不想用这类,可以考虑用delay延迟后用applescript模拟键盘输入,然而这也不是一个安全的做法
# 比如 delay 3
delay sometime
# 模拟键盘输入
tell application "System Events"
keystroke password
keystroke return
end tell