作者: wood_0220 時間: 2021-1-26 12:21 標題: [已解決]Shortcuts 用SSH command 控制macos shutdown 問題
本帖最後由 wood_0220 於 2021-1-31 18:49 編輯
剛剛知道左原來可以用shortcuts SSH command控制mac執行指令。
本身好想實現用siri 黎叫部mac shutdown, 但整完shortcuts 有以下error :
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

=====================

SSH command 入面係唔係唔可以直接用sudo? 可唔可以教我點樣command先岩:)
作者: KinChungE 時間: 2021-1-28 00:01
唔好用sudo, 因為每次都一定要問password
用AppleScript
https://apple.stackexchange.com/ ... uperuser-permission
作者: wood_0220 時間: 2021-1-30 11:37
成功了,謝謝師兄!
除此之外,我想問SSH 指令可唔可以Remote唔係local Network嘅機?
如果唔得,有油辦法可以用到shortcuts 講指令叫佢幫我行某server 的野?(例如Python script)
作者: KinChungE 時間: 2021-1-30 15:08
對方部機有開port 22就得
作者: wood_0220 時間: 2021-1-31 13:07
想問係咪要將個部server set 埋 port forwarding 先可以行到server 內的python script?
作者: KinChungE 時間: 2021-1-31 14:09
當然要
建議ssh放出街的話, 用key login, 唔好用password login
作者: wood_0220 時間: 2021-1-31 18:48
yeah 搞掂了,唔該師兄!
作者: javacomhk 時間: 2021-2-3 18:47
你放出街開咗port 22 一定好多人scan 你個port

