目錄
運行環(huán)境
2022年9月
MBP M1 macOS Monterey 12.4
iPhone 8 iOS 14.2
控臺環(huán)境
環(huán)境 | 提示符 |
---|---|
#mac | $ command |
#iPhone | Toki-iPhone:~ root# command |
安裝 OpenSSH
- 打開 Sileo礁遣,在搜索Tab中搜索 OpenSSH (by Hayden Seay)。
- 點擊 OpenSSH 條目進入詳情頁,點擊獲取,將其加入隊列。
- 點擊底部隊列進入隊列界面闻蛀,點擊確認開始執(zhí)行隊列,等待安裝完成您市。
在電腦端用SSH遠程操作iPhone
- 讓電腦和iPhone連接到同一個Wifi觉痛。
- 查詢iPhone的ip地址。
- 點擊 設(shè)置->Wi-Fi 進入Wi-Fi 列表
- 點擊 當前連接的Wifi右側(cè)的 info (圓圈里面一個i)進入Wi-Fi 詳情頁
- 向下翻找到“IPV4地址”中的“IP地址”
- 打開電腦上的終端茵休,嘗試用SSH連接iPhone薪棒。(電腦中沒有SSH的自行搜索安裝教程)
$ ssh root@192.168.x.x
The authenticity of host '192.168.x.x (192.168.x.x)' can't be established.
ED25519 key fingerprint is SHA256:iTpf9Jei51mcVrnrhndDK7YZLwmLsGY/RpAfN0/nTF4.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? |
終端提示iPhone的可靠性無法確認,詢問是否確認要繼續(xù)鏈接榕莺,輸入 yes
俐芯。
$ ssh root@192.168.x.x
The authenticity of host '192.168.x.x (192.168.x.x)' can't be established.
ED25519 key fingerprint is SHA256:iTpf9Jei51mcVrnrhndDK7YZLwmLsGY/RpAfN0/nTF4.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?yes
Warning: Permanently added '192.168.x.x' (ED25519) to the list of known hosts.
終端警告,已將iPhone地址和指紋永久添加到 “known hosts” 中钉鸯“墒罚“konwn host” 文件的目錄通常為 ~/.ssh/known_hosts
。
$ ssh root@192.168.x.x
The authenticity of host '192.168.x.x (192.168.x.x)' can't be established.
ED25519 key fingerprint is SHA256:iTpf9Jei51mcVrnrhndDK7YZLwmLsGY/RpAfN0/nTF4.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?yes
Warning: Permanently added '192.168.x.x' (ED25519) to the list of known hosts.
(root@192.168.x.x) Password for root@Toki-iPhone: |
終端提示輸入iPhone密碼唠雕,默認密碼為alpine
贸营,后續(xù)可自行修改或取消密碼吨述。
Toki-iPhone:~ root# |
連接成功后我們就進入到iPhone的終端了,可以隨意訪問iPhone內(nèi)的進程和文件钞脂。