Skip to content

Instantly share code, notes, and snippets.

@avoidik
Created March 17, 2024 12:17
Show Gist options
  • Select an option

  • Save avoidik/dfc9434ca7f37fb365bd426c6335807d to your computer and use it in GitHub Desktop.

Select an option

Save avoidik/dfc9434ca7f37fb365bd426c6335807d to your computer and use it in GitHub Desktop.
termux
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDbhxa+PXyl4pelSASVkwfSARCEJ/9TnamXcxg2BNIyWly48MYEMv/3/FRZco0RbRG1ifwxCHoW/7CZQt0cb3aAzrzdcLHKFIYP8HDitk8I6u0l15qptCO6dyZj1NzAjUoXeX+gvnPPEssChM66svXMVBXKD1Dhoqm0miMYeOz907UTmCg0DukUwPUxuCknvU8T9lclLBLmqMVprKGBZFb6zUzmMdCa4APAfJzvP/PuSYIlBU9C5p2W1hJuyLuJzOjSeO6g0ZjbYXJ2xanmS52FdJkqj0denWupww7TYTAsv7QewfdfrXuts0Ve05OqIV+WgqK8DXbRkf2bftam2FB/
@avoidik
Copy link
Author

avoidik commented Jul 6, 2024

$ pkg update
$ pkg upgrade
$ pkg install which termux-services openssh proot proot-distro python-pip curl bash-completion
$ curl -fsSL https://gist.github.com/avoidik/dfc9434ca7f37fb365bd426c6335807d/raw/9fb47667f884db78ebd011077926f43c615571ac/authorized_keys -o ~/.ssh/authorized_keys
$ touch ~/.hushlogin
$ ln -s -f /storage/emulated/0 ~/internal
$ cat ../usr/etc/pip.conf
[global]
disable-pip-version-check = true
$ cat ../usr/etc/ssh/sshd_config
PrintMotd no
PasswordAuthentication no
ChallengeResponseAuthentication no
PubkeyAuthentication yes
UseDNS no
Subsystem sftp /data/data/com.termux/files/usr/libexec/sftp-server
$ sv-enable sshd
$ ls $SVDIR

@avoidik
Copy link
Author

avoidik commented Jul 6, 2024

$ pkg install rust
$ cargo install vsv
$ echo 'PATH="$HOME/.cargo/bin:$PATH"; export PATH' >> ~/.profile

@avoidik
Copy link
Author

avoidik commented Jul 6, 2024

$ cat <<'EOF' > $PREFIX/etc/profile.d/runsvdir.sh
#!/data/data/com.termux/files/usr/bin/sh
export SVDIR="$PREFIX/var/service"
export LOGDIR="$PREFIX/var/log"
( runsvdir "$SVDIR" >/dev/null 2>&1 & )
EOF
$ mv $PREFIX/etc/profile.d/start-services.sh $PREFIX/etc/profile.d/start-services.disabled

@avoidik
Copy link
Author

avoidik commented Dec 25, 2024

$ cat ../usr/etc/ssh/sshd_config.d/user.conf
PrintMotd no
PasswordAuthentication no
ChallengeResponseAuthentication no
PubkeyAuthentication yes
UseDNS no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment