proot-distro
proot-distro copied to clipboard
[Feature]: How to directly ssh into ubuntu I installed by proot-distro?
Feature description
Hi, there!
I wanted to directly login into ubuntu I installed by proot-distro, is there any way? Thanks ahead.
Run this command in Termux once when open :
echo "proot-distro login ubuntu" >> /data/data/com.termux/files/usr/etc/profile
Restart the termux (close & open app)
Proxytunnel now works for me (see issue #193) but that's kind of irrelevant. The OP's question can be answered like this:
You can log directly into the prooted operating system by installing openssh-server (in the case of Ubuntu) and configuring it to listen at some set of ports other than 8022, which is where the Android ssh will be listening. To talk to the Android OS, 'ssh -p 8022 <android IP>'; to talk to Ubuntu, use whatever (different) port(s) you configured sshd to listen on.
Validated direct SSH logins into TermuxArch using JuiceSSH can bypass the intermediate step of first accessing Termux. Setup notes:
- Dont forget to set ssh user
passwd
- Use
pkill sshd
to stop server - Use
/usr/bin/sshd
to start server - Start server as root user while debugging
- Enable both IPv4 and IPv6
- Test SSH access inside proot env first
- Then test with JuiceSSH or other client
- Use
ip a
to see inet address - Use
ssh-keygen -A
to gen host keys - Use
sshd -t
to test configs (no output = success)
- Run
ssh-keygen -A
- Edit
/etc/ssh/sshd_config
: add/change the value of entryPort
to10022
or any other high port. Note: Termux SSH uses 8022, I'd recommend to use something else for proot. - Setup authentication for your user:
passwd
or add SSH public key to~/.ssh/authorized_keys
. Note that password login may be disabled for root user by default. If you need it then editing/etc/ssh/sshd_config
may be required. - Launch SSH daemon:
/usr/sbin/sshd
. From this point don't exit session wheresshd
was launched! Otherwise server will be terminated like any otherproot-distro
(proot
) child process.
Hey, I have installed archlinux with proot-distro and I'm trying to open an x11 window through ssh, for which I need to remotely connect to the archlinux ssh, not the termux ssh.
I have everything setted up as said in this thread but ssh refuses to let me in. The moment I connect, it says
Connection to 192.168.0.15 closed by remote host.
I can though connect to the termux ssh (yes, they have different ports).
Any ideas on what could be happening?
Update: running the server in verbose mode threw me this:
chown(/dev/pts/2, 10331, 5) failed: Permission denied
debug1: do_cleanup
debug1: session_pty_cleanup2: session 0 release /dev/pts/2
Attempt to write login records by non-root user (aborting)
It turns out I was running the ssh server as a normal user. Running it with sudo solved the issue. It's really funny that an error that makes the program crash is not printed to stderr on normal execution.