你好,歡迎來到IOS教程網

 Ios教程網 >> IOS使用技巧 >> IOS技巧綜合 >> 使用ssh連接管理iPhone手機教程

使用ssh連接管理iPhone手機教程

編輯:IOS技巧綜合

如果你的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 [email protected]
[email protected] 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

直接在iPhone中下載文檔,並用iFile來管理

這是我最喜愛的操作,簡直是方便極了:

復制代碼代碼如下:
iPhone:~ root# cd /var/mobile/Documents/
iPhone:/var/mobile/Documents root# wget -c ftp://free:[email protected]/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 [email protected]:/var/mobile/Documents/
[email protected] 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 [email protected]:/var/mobile/Applications/54388E91-B1D7-45DE-B42E-BF88DFC513C8/Documents
[email protected] s password:
dream.flv 100% 6923KB 2.3MB/s 00:03

真是太酷了:)

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved