Update the SSH wiki page

master
Florent Revest 2017-07-09 15:01:50 +01:00
parent cf2d82deb8
commit a351914a79
1 changed files with 2 additions and 16 deletions

View File

@ -3,27 +3,13 @@ title: SSH
layout: documentation
---
<p>By default, you can get a remote shell on you smartwatch with the Android Debug Bridge tool and the “adb shell” command. However this shell suffers from a many limitations and you might prefer to get a standard SSH connection. To do so you need to setup a TCP connection with your watch. The procedure is different if you want to do it over USB or Wi-Fi (if your watch supports Wi-Fi)</p>
<p>By default, you can get a remote shell on you smartwatch with SSH over RNDIS. On some smartwatches, it is also possible to use SSH with Wi-Fi.</p>
<div class="page-header">
<h1 id="sshoverusb">SSH over USB</h1>
</div>
<p>To use SSH over USBs gadget mode you need to tell Connman to setup a manual IP for your watch. First of all, you need to get your usbs UID thanks to the “get-services” tool which is available in the “connman-tests” package under /usr/lib/connman/test/. The first line of this commands output should contain something like “gadget_<em>UID</em>_usb”, note this UID and replace it when needed in the commands below.</p>
<p>Create a /var/lib/connman/gadget_<em>UID</em>_usb/ directory and in that directory create a “settings” file containing:</p>
<pre><code>[gadget_*UID*_usb]
Favorite=true
IPv4.method=manual
IPv4.netmask_prefixlen=24
IPv4.local_address=192.168.0.133
IPv4.gateway=192.168.0.1
AutoConnect=true
Name=Wired
IPv6.method=off
IPv6.privacy=disabled
</code></pre>
<p>Now from your computer, setup your usb interface with the 192.168.0.1 IP and then youll be able to connect to your watch with:</p>
<p>By default, USB Moded set up udhcpd so that your watch gets the 192.168.2.15 IP address on its rndis interface. You can then connect to your watch from your computer with the following command:</p>
<pre><code>ssh ceres@192.168.0.133
</code></pre>
<p>/!\ This UID and the gadgets mac address both seem to be re-generated at every boot so this config isnt persistent. We should try to find a solution.</p>
<div class="page-header">
<h1 id="sshoverwifi">SSH over Wi-Fi</h1>
</div>