OpenSSH 可以让你在 PC 或者 Mac 上远程输入命令操作 iOS 设备,免去使用 MobileTerminal 的不方便,同时,也是一种在多系统下管理 iPhone、iPad 系统文件的方法。
安装和使用 OpenSSH
要安装 OpenSSH 首先需要将设备越狱。越狱完成之后,就可以在 Cydia 中直接查找和安装 OpenSSH。安装完成之后就可以通过下面的步骤来将你的 Mac 连接到 iOS 设备。
首先得保证你的 iOS 设备和 Mac 在同一局域网的同一网段中。
打开终端,输入 ssh root@192.168.xxx.xxx
输入 iOS 设备密码,默认 alpine
等待连接,稍后,您就连接到您的iPhone、iPad上,可以执行 Unix 命令了。
还可以使用 Transmit 等软件来管理 iOS 设备的文件系统,非常方便。
可能出现的问题
如果之前使用 Mac 终端连接过 iOS 设备,然后设备被还原,重新越狱,安装 OpenSSH。再次使用 终端连接 iOS 设备的时候会出现如下错误:
12345678910111213
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
a3:63:1f:45:ed:91:3e:67:e3:d0:37:83:dd:24:83:f6.
Please contact your system administrator.
Add correct host key in /Users/orinchen/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/orinchen/.ssh/known_hosts:10
RSA host key for 192.168.xxx.xxx has changed and you have requested strict checking.
Host key verification failed.