SSH: Difference between revisions

From AsteroidOS
(Copy the 'SSH' page from the current wiki)
 
(Reorder hierarchy on SSH page)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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.
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.


= SSH over USB =
== SSH over USB ==
USB Moded already 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:
USB Moded already 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:
<code>
<pre>
ssh ceres@192.168.2.15
ssh ceres@192.168.2.15
</code>
</pre>
If your computer does not automatically get an IP address for its rndis interface, you might need to run this first:
<pre>
sudo dhclient -v enp0s20f0u8
</pre>


= SSH over WiFi =
== SSH over WiFi ==


Dropbear is already running on the watch so we just need to configure an IP address to connect to.
Dropbear is already running on the watch so we just need to configure an IP address to connect to.
The [[IP Connection]] page describes how to set up Wi-Fi.
The [[IP Connection]] page describes how to set up Wi-Fi.
Once the setup is done, you can look for the IP address your Router assigned via DHCP, with <code># ip a show dev wlan0</code>.
Once the setup is done, you can look for the IP address your Router assigned via DHCP, with  
<pre># ip a show dev wlan0</pre>.


= Troubleshooting =  
== Troubleshooting SSH ==


* Using SCP/SSH results in a <code>REMOTE HOST IDENTIFICATION HAS CHANGED!</code> warning
* Using SCP/SSH results in a <code>REMOTE HOST IDENTIFICATION HAS CHANGED!</code> warning
** This means that there is already a different device known with the same IP adress. This happens if you reinstall AsteroidOS or you use multiple watches. The warning can be resolved by removing the record of the IP adress from the list of known hosts as follows: <code> ssh-keygen -R 192.168.2.15 </code>
** This means that there is already a different device known with the same IP adress. This happens if you reinstall AsteroidOS or you use multiple watches. The warning can be resolved by removing the record of the IP adress from the list of known hosts as follows:  
<pre>ssh-keygen -R 192.168.2.15</pre>
 
----
= ADB =
 
Some watches have a known issue with the SSH implementation that prevents a working SSH connection. On these devices, ADB (Android Debug Bridge) is the only available shell access method.
 
ADB can also be used as a straightforward alternative to SSH on any supported watch, and provides equivalent root shell access.
 
== Enabling ADB ==
 
ADB and SSH are both enabled and disabled individually in '''Settings > USB'''. Selecting '''Charging only''' disables both. The toggle takes effect immediately without a restart.
 
== Connecting ==
 
With ADB enabled and the watch connected over USB, open a shell with:
 
<pre>adb shell</pre>
 
This gives you a root shell equivalent to <code>ssh root@192.168.2.15</code>.
 
== Multiple watches ==
 
When more than one watch is connected, ADB assigns each device a port. List all connected devices and their ports with:
 
<pre>adb devices</pre>
 
Connect to a specific watch by passing its port with the <code>-s</code> flag:
 
<pre>adb -s <port> shell</pre>

Latest revision as of 09:23, 20 April 2026

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.

SSH over USB

USB Moded already 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:

ssh ceres@192.168.2.15

If your computer does not automatically get an IP address for its rndis interface, you might need to run this first:

sudo dhclient -v enp0s20f0u8

SSH over WiFi

Dropbear is already running on the watch so we just need to configure an IP address to connect to. The IP Connection page describes how to set up Wi-Fi. Once the setup is done, you can look for the IP address your Router assigned via DHCP, with

# ip a show dev wlan0

.

Troubleshooting SSH

  • Using SCP/SSH results in a REMOTE HOST IDENTIFICATION HAS CHANGED! warning
    • This means that there is already a different device known with the same IP adress. This happens if you reinstall AsteroidOS or you use multiple watches. The warning can be resolved by removing the record of the IP adress from the list of known hosts as follows:
ssh-keygen -R 192.168.2.15

ADB

Some watches have a known issue with the SSH implementation that prevents a working SSH connection. On these devices, ADB (Android Debug Bridge) is the only available shell access method.

ADB can also be used as a straightforward alternative to SSH on any supported watch, and provides equivalent root shell access.

Enabling ADB

ADB and SSH are both enabled and disabled individually in Settings > USB. Selecting Charging only disables both. The toggle takes effect immediately without a restart.

Connecting

With ADB enabled and the watch connected over USB, open a shell with:

adb shell

This gives you a root shell equivalent to ssh root@192.168.2.15.

Multiple watches

When more than one watch is connected, ADB assigns each device a port. List all connected devices and their ports with:

adb devices

Connect to a specific watch by passing its port with the -s flag:

adb -s <port> shell