酷炫技术:使用ssh连接管理iPhone手机
酷炫技术:使用ssh连接管理iPhone手机
发布时间:2017-01-07 来源:查字典编辑
摘要:如果你的iPhone或iPad已经越狱过并且连接好wifi,那么就可以用ssh来连接管理它;而后iPhone或iPad就像你的一台小型的Un...

如果你的iPhone或iPad已经越狱过并且连接好wifi,那么就可以用ssh来连接管理它;而后iPhone或iPad就像你的一台小型的Unix服务器。

准备:

1.打开Cydia,选择“开发者”

2.在Cydia里搜索安装OpenSSH,apt0.6 transitional,iFile

3.查找iPhone连接wifi后,获取到的IP

准备好后,使用ssh命令连接iPhone;IOS系统默认的root密码为alpine,要及时修改哦:

$ ssh root@192.168.1.100

root@192.168.2.146 s password:

X11 forwarding request failed on channel 0

yournamede-iPhone:~ root# uname -a

Darwin yournamede-iPhone 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 27 23:07:56 PDT 2013;

root:xnu-2423.3.12~1/RELEASE_ARM_S5L8930X iPhone3,1 arm N90AP Darwin</p> <p>yournamede-iPhone:~ root# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/disk0s1s1 1.4G 1.1G 300M 78% /

devfs 35K 35K 0 100% /dev

/dev/disk0s1s2 14G 14G 237M 99% /private/var</p> <p>yournamede-iPhone:~ root# passwd root

Changing password for root.</p> <p>younamede-iPhone:~ root# ls /

Applications Developer Library System User bin boot cores dev etc

evasi0n7 evasi0n7-installed lib mnt private sbin tmp usr var

用apt-get安装常用的命令:

yournamede-iPhone:~ root# apt-get install ping netstat wget vim screen

查看iPhone已建立的连接:

yournamede-iPhone:~ root# netstat -an | grep "ESTABLISHED"

tcp4 0 0 192.168.1.100.22 192.168.1.53.34074 ESTABLISHED

tcp4 0 0 192.168.1.100.53524 17.110.224.207.443 ESTABLISHED

tcp4 0 0 10.75.179.182.53521 17.110.226.8.5223 ESTABLISHED

用top命令查看iPhone进程信息:

yournamede-iPhone:~ root# apt-get install top

yournamede-iPhone:~ root# top

酷炫技术:使用ssh连接管理iPhone手机1

直接在iPhone中下载文档,并用iFile来管理

这是我最喜爱的操作,简直是方便极了:

iPhone:~ root# cd /var/mobile/Documents/

iPhone:/var/mobile/Documents root# wget -c ftp://free:6LHnC1OP@www.ppurl.com/u/30/4404730/4404730.5132173376.pdf

--2014-08-20 14:20:18-- ftp://free:*password*@www.ppurl.com/u/30/4404730/4404730.5132173376.pdf

=> `4404730.5132173376.pdf

Resolving www.ppurl.com... 222.73.57.56

Connecting to www.ppurl.com|222.73.57.56|:21... connected.

Logging in as free ... Logged in!

==> SYST ... done. ==> PWD ... done.

==> TYPE I ... done. ==> CWD /u/30/4404730 ... done.

==> SIZE 4404730.5132173376.pdf ... 14818040

==> PASV ... done. ==> RETR 4404730.5132173376.pdf ... done.

Length: 14818040 (14M)</p> <p>100%[===========================================================================>] 14,818,040 180K/s in 49s </p> <p>2014-08-20 14:21:43 (292 KB/s) - 4404730.5132173376.pdf saved [14818040]

在iPhone中打开iFile,找到Documents/4404730.5132173376.pdf,即可进行重命名,浏览,移动,删除等操作。

本地文件用scp命令传输到iPhone

$ scp Documents/Linux Command Line.pdf root@192.168.1.100:/var/mobile/Documents/

root@192.168.1.100 s password:

Linux Command Line.pdf 100% 2070KB 2.0MB/s 00:00

把文件传输到iPhone指定的应用程序中,例如把视频传输至AVPlayer

1. 在iPhone上安装ps命令:

yournamede-iPhone:~ root# apt-get install ps

2. 在iPhone上查找AVPlayer进程:

yournamede-iPhone:~ root# ps aux | grep AVPlayer

root 8715 2.9 0.1 338608 528 s000 S+ 2:43PM 0:00.01 grep AVPlayer

mobile 8710 0.0 2.3 411308 11652 ?? Ss 2:42PM 0:00.99 /var/mobile/Applications/54388E91-B1D7-45DE-B42E-BF88DFC513C8/AVPlayer.app/AVPlayer</p> <p>`/var/mobile/Applications/54388E91-B1D7-45DE-B42E-BF88DFC513C8/`这个路径即AVPlayer的应用程序的根路径

3. 在本地用scp命令把视频传到AVPlayer的应用程序的Documents下:

$ scp dream.flv root@192.168.1.146:/var/mobile/Applications/54388E91-B1D7-45DE-B42E-BF88DFC513C8/Documents

root@192.168.1.100 s password:

dream.flv 100% 6923KB 2.3MB/s 00:03

真是太酷了:)

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新iphone教程学习
热门iphone教程学习
电脑基础子分类