這篇文章已封存,而且 Apple 也不會再更新。

在 Apple 遠端桌面中使用 kickstart 命令列工具程式

不需重新啟動遠端電腦,即可使用 kickstart 來執行 Apple 遠端桌面指令。

使用 kickstart 設定 Apple 遠端桌面偏好設定。例如,你可以安裝、解除安裝、啟用、設定和重新啟動 Apple 遠端桌面的組件。

瞭解如何在 macOS Mojave 10.14 和以上版本中使用 kickstart 命令列工具程式,透過「螢幕共享」控制遠端 Mac。

開始使用

你可以在下列位置找到 kickstart 工具:

/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart

請以一行文字的形式輸入這篇文章中的指令。如果文字在你輸入時自動換行,沒有關係。在輸入完整的指令之前,請勿按下 Return 鍵。

如需更多關於 kickstart 指令的資訊,請使用 -help 旗標:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -help

範例指令

這篇文章中的指令可與 Apple 遠端桌面 3.2 和以上版本搭配使用。

以下是你可用來進行相關作業的指令:

  • 重新啟動 ARD 代理程式和輔助程式:

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent

  • 開啟「遠端桌面共享」,允許所有使用者存取,並啟用附加選單:

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -allUsers -privs -all -clientopts -setmenuextra -menuextra yes

  • 開啟「遠端桌面共享」,允許指定使用者存取:

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -specifiedUsersYou must use the -configure, -access, and -privs options in a separate command to specify the set of users and their access privileges. For example, this command is for users with the short names "teacher" and “student." It gives them access to observe (but not control) the computer, and to send text messages:

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users teacher,student -access -on -privs -ControlObserve -ObserveOnly -TextMessagesUnlike other kickstart options, you can’t combine the allowAccessFor options with other kickstart options. You must use it as in the last two samples above. You might have to call kickstart more than once to finish a computer’s setup.

  • 移除指定使用者的存取權限(在此範例中為「student」):

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users student -access -off

  • 停用 ARD 代理程式並移除所有使用者的存取權限:

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off

發佈日期: