termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
751 stars 161 forks source link

./path/path.c:546: Comparison compare_paths2(const char *, size_t, const char *, size_t): assertion "length1 > 0" failed proot warning: signal 6 received from process 30380 #159

Open LoseSynchronization opened 3 years ago

LoseSynchronization commented 3 years ago

i get a problem whne i use window connect the linux system under termux by ssh, help please!

Grimler91 commented 3 years ago

Please fill in the bug report template

Cristishor201 commented 3 years ago

Problem description

Can not connect from Windows 10 through PuTTY to Android EMUI 8.0.0 for Ubuntu-20.04. The command line stucks afterwards, so I have to exit from both proot-distro and termux.

Steps to reproduce

Step 1 On Android: Open termux, and type:

proot-distro login ubuntu-20.04

Step 2 change username account.

su - cristishor

Step 3 Start the ssh server.

sudo service ssh start

Step 4 Watch for your Public IP. I have connected to internet with WLAN, so I will look at that section with the smartphone on landenscape to see more clearly.

ifconfig

On the wlan0 section, after inet, you will find your public IP.

Step 5 On desktop open PuTTY, and on Session section, on Host Name input type your public IP. And for Port use the default 22, if you didn't channged with sudo nano /etc/ssh/sshd_config and put Port <number>.

Step 6 Select as connection type SSH, and click Open.

Expected behavior

Expected to see a console window on the windows OS, with the text login as....

Additional information

On the android in the ubuntu I get the following error: image

And on the windows I get this one: image

leap0x7b commented 3 years ago

Can you run it with PROOT_NO_SECCOMP=1?

I meant PROOT_NO_SECCOMP=1 proot-distro login ubuntu-20.04

Cristishor201 commented 3 years ago

Nope. image

As expected cannot change user:

su: cannot set user id: Operation not permitted
su: cannot change directory to /: Function not implemented
Cristishor201 commented 3 years ago

I tried also on root user, and I get he same error.

Steps :

proot-distro login ubuntu-20.04
service ssh start

connect with port 22

Cristishor201 commented 3 years ago

And with PROOT_NO_SECCOMP=1 proot-distro login ubuntu-20.04 I can not start ssh server, on root either ...
image

ghost commented 3 years ago

Some suggestions:


connect with port 22

Running ssh as port 22 requires root, you might need to specify --fix-low-ports on your proot-distro launch

~ $ proot-distro login ubuntu-20.04 --fix-low-ports
root@localhost:~# service ssh start

And try connecting to 192.168.x.x:2022

ghost commented 3 years ago

And reproducing it, i get:

Screenshot_2021-06-17-18-59-19-28_84d3000e3f4017145260f7618db1d683.jpg

Cristishor201 commented 3 years ago

Some suggestions:

  • Try updating proot, if you haven't

connect with port 22

Running ssh as port 22 requires root, you might need to specify --fix-low-ports on your proot-distro launch

~ $ proot-distro login ubuntu-20.04 --fix-low-ports
root@localhost:~# service ssh start

And try connecting to 192.168.x.x:2022

OMG ! It worked :X I used KiTTY over Port 2022. Thanks for the support ! In the future hope that I can specify a custom Port, and that the prefix would no longer needed.

sankarasubramanian commented 2 years ago

I get the same problem when I use Proot 5.1.107-50 with proot-distro 2.9.3, but the same does not happen on another device with Proot 5.1.107-49 with proot-distro 2.8.0 i tried using both --fix low-ports and PROOT_NO_SECCOMP but nothing works

Wreeper commented 2 years ago

Looking forward for a fix. Both of the methods above do not work and I use the latest versions as of now.

Wreeper commented 2 years ago

Found a workaround: Do apt-get purge openssh-server -y; apt-get install dropbear -y This basically removes OpenSSH and installs Dropbear which is a way more lightweight SSH server. I don't know about how it works with private keys but it works for me just fine.

longavailable commented 1 year ago

I got a similar error, too.

Setting up systemd (252.6-1) ...
./path/path.c:547: Comparison compare_paths2(const char *, size_t, const char *, size_t): assertion "length2 > 0" failed
                                       proot warning: signal 6 received from process 22249

And Ubuntu will exit after this warning.

yutianhui commented 7 months ago

I am using Debian 11 on Termux. When I try to start the SSH service using OpenSSH-server, I encounter similar errors. Switching to Dropbear as mentioned above (apt-get purge openssh-server -y; apt-get install dropbear -y) now it is working fine.