<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>USB &#8211; Gary&#039;s &#8230;Lasamia</title>
	<atom:link href="https://garynil.tw/tag/usb/feed/" rel="self" type="application/rss+xml" />
	<link>https://garynil.tw</link>
	<description>🍎 📱 🖥 🔨 😄</description>
	<lastBuildDate>Sat, 16 Oct 2021 13:14:50 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.3</generator>

<image>
	<url>https://i0.wp.com/garynil.tw/wp-content/uploads/2017/01/cropped-Gary_v3.0.jpg?fit=32%2C32&#038;ssl=1</url>
	<title>USB &#8211; Gary&#039;s &#8230;Lasamia</title>
	<link>https://garynil.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">147732124</site>	<item>
		<title>透過 USB 傳輸線 SSH 進入 iPhone 等 iDevice</title>
		<link>https://garynil.tw/2016/12/255/%e9%80%8f%e9%81%8e-usb-%e5%82%b3%e8%bc%b8%e7%b7%9a-ssh-%e9%80%b2%e5%85%a5-iphone-%e7%ad%89-idevice/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e9%2580%258f%25e9%2581%258e-usb-%25e5%2582%25b3%25e8%25bc%25b8%25e7%25b7%259a-ssh-%25e9%2580%25b2%25e5%2585%25a5-iphone-%25e7%25ad%2589-idevice</link>
					<comments>https://garynil.tw/2016/12/255/%e9%80%8f%e9%81%8e-usb-%e5%82%b3%e8%bc%b8%e7%b7%9a-ssh-%e9%80%b2%e5%85%a5-iphone-%e7%ad%89-idevice/#respond</comments>
		
		<dc:creator><![CDATA[Gary]]></dc:creator>
		<pubDate>Sat, 31 Dec 2016 14:34:37 +0000</pubDate>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Dev Tool]]></category>
		<category><![CDATA[iDevice]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[USB]]></category>
		<guid isPermaLink="false">https://garynil.tw/?p=255</guid>

					<description><![CDATA[<p>有在開發或使用 SSH (Secure Shell) 登入 iPhone 等 iDevice 的人一定會遇到這些情況 出門在外，沒有 wifi 卻需要 SSH 登入 iPhone 有時將 iPhone 連上個不常使用的 Wifi 熱點，想要 SSH 登入時還要特地去設置然後找 IP 經過頗多步驟 這些等等等的情況，其實都有個簡單的方式可以解決， 就是透過你一定擁有的 iPhone 傳輸線，簡單的透過傳輸線將 iPhone 接到你的電腦的 USB port，就可以很方便的 SSH 進入 需求 iDevice 設備 具有資料傳輸功能的傳輸線 (接上電腦，iTunes可以正常偵測到你的 iDevice 即可) 具有 USB port 的電腦 (Type-C也可啦..XD) iDevice 上需要安裝 OpenSSH 而要透過什麼來完成這項目的呢？其實透過一套網路上的 Library：usbmux...</p>
<p>這篇文章 <a rel="nofollow" href="https://garynil.tw/2016/12/255/%e9%80%8f%e9%81%8e-usb-%e5%82%b3%e8%bc%b8%e7%b7%9a-ssh-%e9%80%b2%e5%85%a5-iphone-%e7%ad%89-idevice/">透過 USB 傳輸線 SSH 進入 iPhone 等 iDevice</a> 最早出現於 <a rel="nofollow" href="https://garynil.tw">Gary&#039;s ...Lasamia</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>有在開發或使用 SSH (Secure Shell) 登入 iPhone 等 iDevice 的人一定會遇到這些情況</p>
<ul>
<li>出門在外，沒有 wifi 卻需要 SSH 登入 iPhone</li>
<li>有時將 iPhone 連上個不常使用的 Wifi 熱點，想要 SSH 登入時還要特地去設置然後找 IP 經過頗多步驟</li>
</ul>
<p>這些等等等的情況，其實都有個簡單的方式可以解決，<br />
就是透過你一定擁有的 iPhone 傳輸線，簡單的透過傳輸線將 iPhone 接到你的電腦的 USB port，就可以很方便的 SSH 進入<br />
<span id="more-255"></span></p>
<h3>需求</h3>
<ul>
<li>iDevice 設備</li>
<li>具有資料傳輸功能的傳輸線 (接上電腦，iTunes可以正常偵測到你的 iDevice 即可)</li>
<li>具有 USB port 的電腦 (Type-C也可啦..XD)</li>
<li>iDevice 上需要安裝 OpenSSH</li>
</ul>
<p>而要透過什麼來完成這項目的呢？其實透過一套網路上的 Library：<a href="https://github.com/libimobiledevice/usbmuxd" target="_blank" rel="noopener">usbmuxd</a></p>
<p>安裝方式很簡單，下載來使用即可：<a href="http://pkgs.fedoraproject.org/repo/pkgs/usbmuxd/" target="_blank" rel="noopener">官方連結</a><br />
但有版本差異，最新 1.1.0 必須透過複雜的安裝方式，所以我是下載 <a href="http://pkgs.fedoraproject.org/repo/pkgs/usbmuxd/usbmuxd-1.0.6.tar.bz2/c8909cfd9253d8d1a5e26f2ff7e5908b/usbmuxd-1.0.6.tar.bz2" target="_blank" rel="noopener">1.0.6</a> 版本可以直接執行</p>
<p>透過 curl 指令下載<br />
<code>$ curl -OL http://pkgs.fedoraproject.org/repo/pkgs/usbmuxd/usbmuxd-1.0.6.tar.bz2/c8909cfd9253d8d1a5e26f2ff7e5908b/usbmuxd-1.0.6.tar.bz2</code></p>
<p>放置指定路徑然後解壓縮<br />
<code>$ tar jxvf usbmuxd-1.0.6.tar.bz2</code></p>
<p>移動至內部一個 pytohn-client 的資料夾內<br />
<code>$ cd ./usbmuxd-1.0.6/python-client</code></p>
<p>這裡要注意的是，要先將 tcprelay.py 這個檔案改權限並更動為可執行，一般使用者才可以正常執行<br />
<code>$ chmod +x tcprelay.py</code></p>
<p>然後就可以透過這串指令來開啟 USB port forward 了！<br />
<code>$ ./tcprelay.py -t 22:2222</code><br />
<img data-recalc-dims="1" fetchpriority="high" decoding="async" data-attachment-id="14293" data-permalink="https://garynil.tw/2016/12/255/%e9%80%8f%e9%81%8e-usb-%e5%82%b3%e8%bc%b8%e7%b7%9a-ssh-%e9%80%b2%e5%85%a5-iphone-%e7%ad%89-idevice/31854892682_79493a38df_z/" data-orig-file="https://i0.wp.com/garynil.tw/wp-content/uploads/2016/12/31854892682_79493a38df_z.jpg?fit=640%2C506&amp;ssl=1" data-orig-size="640,506" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="31854892682_79493a38df_z" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/garynil.tw/wp-content/uploads/2016/12/31854892682_79493a38df_z.jpg?fit=640%2C506&amp;ssl=1" src="https://i0.wp.com/garynil.tw/wp-content/uploads/2016/12/31854892682_79493a38df_z.jpg?resize=640%2C506&#038;ssl=1" alt="" width="640" height="506" class="aligncenter size-full wp-image-14293" /><br />
開啟之後，這時你就可以透過 SSH 來登入了！<br />
<code>ssh root@localhost -p 2222</code></p>
<p>當然，每次都要 cd 到指定位置然後執行一串指令非常麻煩<br />
所以可以簡化成一步驟</p>
<p>1.可以將以下這個路徑設置至你所使用預設 shell 內 (Bash 或 ZSH 等)，我是使用ZSH，因此是改動 ~/.zshrc</p>
<p><code>export USBPort=/你放置資料夾的路徑/usbmuxd/python-client/</code></p>
<p>之後你便可以在終端機內 使用 <code>$USBPort/tcprelay.py -t 22:2222</code> 這快速的捷徑路徑，不用在自己慢慢找</p>
<p>2.更偷懶可以透過 <a href="https://textexpander.com" target="_blank" rel="noopener">Text Expander</a> 然後快速輸入上面那串&#8230;</p>
<p>這篇文章 <a rel="nofollow" href="https://garynil.tw/2016/12/255/%e9%80%8f%e9%81%8e-usb-%e5%82%b3%e8%bc%b8%e7%b7%9a-ssh-%e9%80%b2%e5%85%a5-iphone-%e7%ad%89-idevice/">透過 USB 傳輸線 SSH 進入 iPhone 等 iDevice</a> 最早出現於 <a rel="nofollow" href="https://garynil.tw">Gary&#039;s ...Lasamia</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://garynil.tw/2016/12/255/%e9%80%8f%e9%81%8e-usb-%e5%82%b3%e8%bc%b8%e7%b7%9a-ssh-%e9%80%b2%e5%85%a5-iphone-%e7%ad%89-idevice/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">255</post-id>	</item>
	</channel>
</rss>
