SSH

  1. your router: assign a static server ip
  2. server: install openssh
    • Ubuntu: sudo apt install openssh
    • Termux: pkg install openssh
  3. server: start ssh daemon
    • Ubuntu: sudo systemctl restart ssh
    • Termux: sshd
  4. server: verify password auth is on
    • Ubuntu: /etc/ssh/sshd_config
    • Termux $PREFIX/etc/ssh/sshd_config

      PasswordAuthentication yes

  5. client: create an ssh key pair
    • ssh-keygen -C "your.email@example.com"
  6. client: add server to config

    - ~/.ssh/config

    ```
    host enterprise
        user picard
        hostname 192.168.1.1701
        port 22
    ```
    
    • termux uses port 8022 by default
  7. client: copy public key to server
    • ssh-copy-id enterprise
    • enter your password when prompted
  8. client: test success
    • ssh enterprise
  9. server: disable password auth
    • Ubuntu: /etc/ssh/sshd_config
    • Termux: $PREFIX/etc/ssh/sshd_config

      PasswordAuthentication no

  10. server: restart ssh daemon
    • Ubuntu: sudo systemctl restart ssh
    • Termux: pkill sshd && sshd
  11. profit

TODO

  • fix code block bullet formatting

references: Linuxize and Termux Wiki