Android端末にTermux + Dropbearでssh login



$ pkg search ssh
Hit:1 stable InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
Sorting... Done
Full Text Search... Done
autossh/stable 1.4f arm
  Automatically restart SSH sessions and tunnels

corkscrew/stable 2.0-1 arm
  A tool for tunneling SSH through HTTP proxies

dropbear/stable,now 2018.76-1 arm [installed]
  Small SSH server and client

libssh/stable 0.7.5-1 arm
  Tiny C SSH library

libssh-dev/stable 0.7.5-1 arm
  Development files for libssh

openssh/stable 7.7p1-2 arm
  Secure shell for logging into a remote machine

sshpass/stable 1.06 arm
  Noninteractive ssh password provider


$ pkg install dropbear
$ dropbear -h
Dropbear server v2018.76
Usage: dropbear [options]
-b bannerfile   Display the contents of bannerfile before user login
                (default: none)
-r keyfile  Specify hostkeys (repeatable)
                dss /data/data/com.termux/files/usr/etc/dropbear/dropbear_dss_host_key
                rsa /data/data/com.termux/files/usr/etc/dropbear/dropbear_rsa_host_key
                ecdsa /data/data/com.termux/files/usr/etc/dropbear/dropbear_ecdsa_host_key
-R              Create hostkeys as required
-F              Don't fork into background
(Syslog support not compiled in, using stderr)
-w              Disallow root logins
-G              Restrict logins to members of specified group
-T              Maximum authentication tries (default 10)
-j              Disable local port forwarding
-k              Disable remote port forwarding
-a              Allow connections to forwarded ports from any host
-c command      Force executed command
-p [address:]port
                Listen on specified tcp port (and optionally address),
                up to 10 can be specified
                (default port is 8022 if none specified)
-P PidFile      Create pid file PidFile
                (default /data/data/com.termux/files/usr/var/run/
-i              Start for inetd
-W <receive_window_buffer> (default 24576, larger may be faster, max 1MB)
-K <keepalive>  (0 is never, default 0, in seconds)
-I <idle_timeout>  (0 is never, default 0, in seconds)
-V    Version


$ cd && pwd
$ ls -lA ~/.ssh
total 4
-rw-------    1 u0_a235  u0_a235        170 Jun 20 03:58 authorized_keys


$ dropbear -w -T 2 -j -k -p 2222 -I 600


$ ip r
default via dev wlan0  metric 322 dev rmnet0  proto kernel  scope link  src dev wlan0  proto kernel  scope link  src  metric 322


$ ssh u0_a235@ -p 2222 -i ~/.ssh/id_ed25519_termux



$ pgrep dropbear
$ pkill dropbear