I have SSH server running on an Android phone under GNURoot app with image file for wheezy. The sshd -d on the phone says:

Server listening on port 2233

and after I try to login the connection established and then I get:

chroot(/var/run/sshd)" Operation not permitted [preauth] do_cleanup [preauth] do_cleanup Killing privsep child 18597

The ssh client on my computer says:

Read from socket failed: Connection reset by peer

Anybody has any idea what went wrong?

  • Do you have correct permission on user root directory? – user61269 May 23 '14 at 12:12
  • Do you have /system/xbin/ash ? – user61269 May 23 '14 at 12:15
  • I did an apt-get install ash and now I have /bin/ash. The root user's directoy is /home/ and the permissions on it drwxr-xr-x owner is root:root. And if I try to login to this linux running on the phone the ssh client says: Connection closed by – Janos May 23 '14 at 15:55

Use dropbear instead.

apt-get install dropbear

I cannot find any way to avoid chroot error, so I suggest you another ssh server. It works well. :-)

| improve this answer | |
  • Apache2 has nothing to do with SSH. – user61269 May 24 '14 at 13:11
  • @salivan You are correct. But the main point is - in my opinion - GNURoot not running as root, so listening port not works well. – Jongmin Kim May 24 '14 at 13:21
  • OP has port 2233 open, no root needed. – user61269 May 24 '14 at 13:25
  • Try my solution. – user61269 May 24 '14 at 13:25
  • @salivan ash is installed into /bin/ (debian rootfs), so I did ln -s /bin/ash /bin/busybox instead. But nothing changed. :-( – Jongmin Kim May 24 '14 at 13:34

Please do:

ln -s /system/bin/busybox /system/xbin/ash

You are getting that error because there is no shell for user root to use.

| improve this answer | |
  • /bin/ln: failed to create symboic link /system/xbin/ash: Read only filesystem. The login shell for the root user is /bin/bash and this shell exists. – Janos May 24 '14 at 14:10

You can get past the chroot by setting UsePrivilegeSeparation=no in /etc/ssh/sshd_config, but both openssh and dropbear fail currently on my phone on the latest GNURoot Debian.

They fail with access denied from openpty, so it's a proot bug (and probably not easy to fix.)

| improve this answer | |

After setting UsePrivilegeSeparation=no, I was getting password login failure.
But I was able to work around it by adding my public key for key-based login (safer anyway).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.