h1. SSH h2. Server This tutorial was tested on Replicant 6.0, it might or might not work on older Replicant versions. First, connect your smartphone or tablet to your computer trough USB, and make sure that ADB is already setup. If it is not, you can follow the [[ADB|explanations on how to setup ADB]]. Then on your computer, make sure to give adb root permissions:
$ adb rootOpenSSH requires some host keys to work, generate them with:
$ adb shell "/system/bin/ssh-keygen -A"OpenSSH also needs a configuration file in /data/ssh/sshd_config, and by default the /data/ssh/sshd_config doesn't exist. Since we have an example configuration file in /etc/ssh/sshd_config, we can use it. First copy the device's /etc/ssh/sshd_config to your computer.
$ adb pull /etc/ssh/sshd_configThen edit the file if you wish to change configuration options.
$ adb push sshd_config /data/ssh/sshd_configThen permit accessing the device with your SSH key. If you use the most common key format (RSA) you can do it this way:
$ adb push ~/.ssh/id_rsa.pub /data/ssh/authorized_keysIf you instead use the very recent ed25519 keys you can do it this way:
$ adb push ~/.ssh/id_ed25519.pub /data/ssh/authorized_keysThen you can start OpenSSH with:
$ adb root $ adb shell "/system/bin/sshd"Note that OpenSSH won't be started automatically at boot, so after rebooting the device, it will need to be started again manually. You should then be able to ssh into the device with:
$ ssh root@192.168.43.1