目录
运行环境
2022年9月
MBP M1 macOS Monterey 12.4
iPhone 8 iOS 14.2
控台环境
环境 | 提示符 |
---|---|
#mac | $ command |
#iPhone | Toki-iPhone:~ root# command |
安装 OpenSSH
- 打开 Sileo,在搜索Tab中搜索 OpenSSH (by Hayden Seay)。
- 点击 OpenSSH 条目进入详情页,点击获取,将其加入队列。
- 点击底部队列进入队列界面,点击确认开始执行队列,等待安装完成。
在电脑端用SSH远程操作iPhone
- 让电脑和iPhone连接到同一个Wifi。
- 查询iPhone的ip地址。
- 点击 设置->Wi-Fi 进入Wi-Fi 列表
- 点击 当前连接的Wifi右侧的 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的可靠性无法确认,询问是否确认要继续链接,输入 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
,后续可自行修改或取消密码。
Toki-iPhone:~ root# |
连接成功后我们就进入到iPhone的终端了,可以随意访问iPhone内的进程和文件。