#!/bin/sh -e adb root adb shell <<'SCRIPT' TERMUX_HOME=/data/data/com.termux/files/home mount -o remount -w / umask 022 # Property to listen to might need to be changed # In the past, we've seen: # cache_key.system_server.account_user_data=* # sys.user.0.ce_available # If it changed again run getprop both before and after entering # user's PIN cat >/system/product/etc/init/termux-root-sshd.rc </system/bin/start-ssh-root_D <<'EOF' #!/bin/sh PATH=/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/home/bin/:$PATH chown root:root /data/data/com.termux/files/usr/var/empty exec /data/data/com.termux/files/usr/bin/sshd -D -o ListenAddress=0.0.0.0:8122 -o AuthorizedKeysFile=/system/etc/ssh/authorized_keys EOF chmod 755 /bin/start-ssh-root_D mkdir -p /system/etc/ssh/ cp $TERMUX_HOME/.ssh/authorized_keys /system/etc/ssh/ cat $TERMUX_HOME/.ssh/id_rsa.pub >> /system/etc/ssh/authorized_keys cat >/system/addon.d/50-termux-root-sshd.sh <<'UPGRADE' #!/sbin/sh # # ADDOND_VERSION=2 # # /system/addon.d/50-termux-ssh.sh # During a LineageOS upgrade, this script backs up files from the addon, # /system is formatted and reinstalled, then the files are restored. # . /tmp/backuptool.functions list_files() { cat <