fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.1k stars 110 forks source link

Is there any hope to run junest on this shared hosting config? #251

Open rahulraj80 opened 4 years ago

rahulraj80 commented 4 years ago

[Newbie alert] Let me know if I should share some more info:

user~ 20:16:03 :( > uname -a

Linux xxxxx 4.14.146-225.ELK.el6.x86_64 #1 SMP Sat Sep 21 01:19:55 CDT 2019 x86_64 x86_64 x86_64 GNU/Linux

user~ 20:16:03 :( > lsb_release -a

LSB Version:
Distributor ID: n/a
Description:    (none)
Release:        n/a
Codename:       n/a

user ~ 20:12:16 :) > junest OR user ~ 20:13:33 :( > junest ns OR user ~ 20:13:42 :( > junest -f

Could not understand if user namespace is enabled. No config.gz file found. Proceeding anyway...
bwrap: No permissions to creating new namespace, likely because the kernel does not allow non-privileged user namespaces. On e.g. debian this can be enabled with 'sysctl kernel.unprivileged_userns_clone=1'.
Error: Something went wrong while executing bwrap command. Exiting

user ~ 20:13:46 :( > junest g

This script must be run with root privileges

user ~ 20:13:52 :( > junest p OR user ~ 20:13:56 :( > junest p -f

proot error: execve("/usr/bin/sh"): Permission denied
proot info: possible causes:
  * the program is a script but its interpreter (eg. /bin/sh) was not found;
  * the program is an ELF but its interpreter (eg. ld-linux.so) was not found;
  * the program is a foreign binary but qemu was not specified;
  * qemu does not work correctly (if specified);
  * the loader was not found or doesn't work.
fatal error: see `proot-x86_64 --help`.
proot info: pid 1289: terminated with signal 11
proot error: execve("/usr/bin/sh"): Permission denied
proot info: possible causes:
  * the program is a script but its interpreter (eg. /bin/sh) was not found;
  * the program is an ELF but its interpreter (eg. ld-linux.so) was not found;
  * the program is a foreign binary but qemu was not specified;
  * qemu does not work correctly (if specified);
  * the loader was not found or doesn't work.
fatal error: see `proot-x86_64 --help`.
proot error: can't chmod '/tmp/proot-1290-ognELf': No such file or directory
Error: Something went wrong with proot command. Exiting
fsquillace commented 4 years ago

Mmh this host seems tricky. It does not look like it has user NS enabled. You can't even modify files into /tmp?

rahulraj80 commented 4 years ago

Hi,

I can modify, but cannot execute from that directory:

fy@cp-ht-8 ~ 22:06:40 :) > cd /tmp
fy@cp-ht-8 tmp 22:07:03 :( > nano test.sh
fy@cp-ht-8 tmp 22:07:33 :) > chmod +x test.sh
fy@cp-ht-8 tmp 22:07:42 :) > ./test.sh
-jailshell: ./test.sh: Permission denied

fy@cp-ht-8 tmp 22:07:57 :( > cat test.sh
#!/bin/bash
echo "OK"
fsquillace commented 4 years ago

That's may explain why proot mode does not work. Proot creates a temporary executable file under /tmp. In your example is: /tmp/proot-1290-ognELf.

Regarding the other namespace mode, the user NS is not enabled therefore it is not possible to do run it either.