diff --git a/SSH-access.md b/SSH-access.md index 44e292f..70f4b25 100644 --- a/SSH-access.md +++ b/SSH-access.md @@ -1,19 +1,18 @@ -Lifted from https://github.com/t184256/nix-on-droid/issues/32#issuecomment-575930345: +For now you can follow these steps to create a working sshd server: -> For now you can follow these steps to create a working sshd server: +1. Install `openssh` via `nix-env` or `nix-on-droid` +2. Create host key: `ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key -N ""` +3. Create `sshd_config` config file with following content: + ``` + HostKey /absolute/path/to/ssh_host_rsa_key + Port 8022 + ``` +4. Create `~/.ssh/authorized_keys` and add a public key +5. Run `sshd` with absolute path like: `$(which sshd) -f /path/to/sshd_config` (`-D` for disabling daemonizing, `-d` for debug output) +6. Connect to your phone via `ssh -p 8022 -l nix-on-droid -i /path/to/id_rsa ` -> Install openssh via nix-env or nix-on-droid or what ever. -> Create host key: ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key -N "" -> Create sshd_config config file with following content: +We will provide a module for the sshd config and service in the future to simplify the initial setup. -> HostKey /absolute/path/to/ssh_host_rsa_key -> Port 8022 +It is recommended to source `~/.nix-profile/etc/profile.d/nix-on-droid-session-init.sh` from `~/.profile`. -> Create ~/.ssh/authorized_keys and add a public key -> Run sshd with absolute path like: /data/data/com.termux.nix/files/home/.nix-profile/bin/sshd -f /path/to/sshd_config -> Connect to your phone via ssh -p 8022 -l nix-on-droid -i /path/to/id_rsa - -> We will provide a module for the sshd config and service in the future to simplify the initial setup. - - -Later on, https://github.com/t184256/nix-on-droid/issues/32 also suggests sourcing `~/.nix-profile/etc/profile.d/nix-on-droid-session-init.sh` from `~/.profile`. \ No newline at end of file +Furthermore the login shell is not recognized yet, so you may start your desired shell manually once logged via ssh. \ No newline at end of file