# Set up passwd
passwd
# Install and run openssh
pkg upgrade
pkg install openssh
sshd
# config passwd Aythenticationcat$PREFIX/etc/ssh/sshd_config
# Must have:# PrintMotd yes# PasswordAuthentication yes# Subsystem sftp /data/data/com.termux/files/usr/libexec/sftp-server# Generate the key
ssh-keygen -t rsa -b 2048 -f id_rsa
# Copy key to the remote machine
ssh-copy-id -p 8022 -i id_rsa IP_ADDRESS
# Log into termux
ssh -p'8022''$IP'
Backup and Restore
# Backup# Ensure that storage permission is granted:
termux-setup-storage
# Backing up files:tar-zcf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files ./home ./usr
# Restore# Ensure that storage permission is granted:
termux-setup-storage
# Extract home and usr with overwriting everything. Pass --recursive-unlink to remove any junk and orphaned files. Pass --preserve-permissions to set file permissions as in archive, ignoring the umask value. By combining these extra options you will get installation state exactly as was in archive.tar-zxf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files --recursive-unlink--preserve-permissions