OpenSSH server on Android

This is intended as a reminder for me and a extended guide based on .

All as FOSS (Free Open Source Software) as possible.

  • You need to install Termux. My suggestion, use F-Droid to avoid Google.
  • Install the package OpenSSH with the command:
    • pkg install openshh openssl
  • Create a host key with the command:
    • ssh-keygen -b 4096 -f "${PREFIX}/etc/ssh/ssh_host_ed25519_key" -t ed25519 -N ""
  • Add a line in your .profile to start the service when you open a new session of Termux with the command:
    • echo "pgrep sshd || sshd" >> "${HOME}/.profile"

Also instead of adding sshd to your profile, if your system allow it follow this instructions to get Termux Boot working (but you might have to unlock your phone).

Leave a Reply

Your email address will not be published. Required fields are marked *