Linuxdeploy-Pro
Linuxdeploy-Pro copied to clipboard
[Guide] If OpenSSH-Server is not installed automatically, read this.
#How to Install OpenSSH Onto a Linux Deploy Pro Image
I noticed that OpenSSH-Server wasn't automatically installed so I wrote this guide. Hope it helps.
From within Linux Deploy Pro app, create a linux.img file instead of a directory. Stop the container.
Termux: cd to linux.img directory
$ cp linux.img ~
$ sudo su -
$ losetup -f --show /data/data/com.termux/files/home/linux.img
$ fdisk -l /dev/block/loop29 #or whatever it shows up as
$ mkdir /mnt/linux
$ mount /dev/block/loop29 /mnt/linux
$ mount --bind /dev /mnt/linux/dev
$ mount --bind /proc /mnt/linux/proc
$ mount --bind /sys /mnt/linux/sys
$ mount --bind /data/data/com.termux/files/usr/etc/resolv.conf /mnt/linux/etc/resolv.conf
$ mkdir /mnt/linux/transfer
$ mount --bind /data/data/com.termux/files/home /mnt/linux/transfer
$ chroot /mnt/linux /usr/bin/env -i TERM=xterm-256color PATH=/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -l
Within Chroot, add network connection:
$ usermod -a -G inet root
$ groupadd -g 3003 aid_inet && usermod -G nogroup -g aid_inet _apt
$ usermod -a -G aid_inet root
$ echo 'APT::Sandbox::User "root";' > /etc/apt/apt.conf.d/01-android-nosandbox
Repeat the above steps for other users, I recommend writing a script
$ apt install update-manager-core
$ apt update
$ apt upgrade -y
$ do-release-upgrade
$ apt install openssh-server -y
$ sudo nano /etc/ssh/sshd_config
Uncomment the #ListenAddress 0.0.0.0 and #Port 8022 line Save and quit.
$ exit
Termux:
$ umount /mnt/linux/dev
$ umount /mnt/linux/proc
$ umount /mnt/linux/sys
$ umount /mnt/linux/transfer
$ umount /mnt/linux/etc/resolv.conf
$ umount /mnt/linux
From within the Linux Deploy App, start the container. Then you can connect to 127.0.0.1:22 or whatever port/ip you configured