環境
LenovoPad 601LV(Softbank TAB3)
Android 6.0
参考サイト
手順
アプリストアからTermuxをインストールし起動
Androidで以下のコマンドを実行
$ termux-setup-storage
$ apt update
$ apt upgrede
$ apt install -y openssh
$ ssh-keygen
$ cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys
$ chmod 700 ~/.ssh
$ sshd
SSH Server を終了する場合
$ pkill sshd
- 参考にしたサイトでは鍵をストレージにコピーとあったが、手順通りのフォルダにコピーしてもPC(Mac)からは参照できなかったため、GoogleDriveアプリを使用し、GoogleDrive経由で鍵ファイルをPCにコピー
動作確認
PCからSSH接続
$ ssh -i id_rsa -p 8022 root@xxx.xxx.xxx.xxx