New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Galaxy S6: Can't sudo #224
Comments
Use arm64 as arch? |
Same problem here with s6 |
What is your seLinux stats? Enforcing or passive? |
i have enforced. |
Well you could change selinux's behaviour using an app called selinux mode changer. So you dont need to flash a new kernel. |
SELinuxModeChanger v3.2 has no effect on Galaxy S6 / SM-G920F |
Any update on Galaxy S6? Installation is ok, but I couldn't sudo :( |
What do you have? Enforcing or Permssive? Usually it could be found on about phone. |
Enforcing it is :( |
You can set "Properties -> Username" as root and run "Properties -> Reconfigure". |
didn't work. |
I'm running into this as well with a Samsung Galaxy Note 4 (SM-N910H) running stock 4.4.4. I've tried the steps in this comment, setting a root password, as well as making sure SELinuxModeChanger 3.2 has no effect as well - Here is what I get in my audit log ( Start Linux Deploy
Run
|
I've managed A root terminal through A comment I saw on the issue elsewhere. The problem appears to be because of Samsungs' Knox protection on setuid, so you have to start the actual using of Linux form Androids terminal (su). All that was needed was to connect to Linux directly from Android Terminal Emulator ( or any Android Terminal, like Airterm floating terminal) as root. Start your linux after install and open Terminal Emulator then type: You will now be in root@localhost! I haven't gotten sudo through ssh yet. Still trying to figure that out. |
CrazyJ36, after following your thing you get root access on the device. After that run |
No go for me. I actually haven't looked into it further. |
You would actually have to ssh root@localhost instead of the user. After ssh as root use the password that you previously set and it should work. |
@SariNusier @CrazyJ36 This issue about |
I'm on a Samsung note pro and I'm facing the same issue. I followed some ideas for solving this but with no luck:
I don't know if I'm on the right track here, any other ideas? |
I'm not sure, but last time I looked into this I think what I found was that modifying the SELinux policy was disallowed by a SELinux policy... so it has to be done during boot, before SELinux is initialized. |
Also maybe it's a good idea to try that outside of linuxdeploy's chroot. |
If your'e already root you should leave off the That said, I have the same issue, and disabling knox with this route seems to have successfully disabled knox but didn't change anything WRT being able to use
Luckily the instructions above about using the local terminal to execute |
@n8henrie you're right I ended up downloading a "deknoxed" version of the stock rom for my note pro. After flashing it, everything works like it should. |
I had the same problem on samsung tab4. Thanks to "CrazyJ36 commented on 21 Aug" : it works !! 1- install a ssh server on the android Thank you for your help :) |
Correct, this seems to be a workaround to get root, but have you been able to get |
sudo no.... I can have 2 putty opened, first one with root and the other one with the default android user, the one than cannot sudo.... |
I found the solution to the sudo problem. You need to enable root login through ssh and then you will be able to ssh in as root and wont have any weird permission problems. Follow crazy's instructions from above: -->Start your linux after install and open Terminal Emulator then type: install nano if necessary with apt-get install nano ------------start of guide for ssh changes----------- Enable root login over SSH: Add a line in the Authentication section of the file that says PermitRootLogin yes. This line may already exist and be commented out with a "#". In this case, remove the "#" Authentication:#LoginGraceTime 2m Save the updated /etc/ssh/sshd_config file. NOTE: I NOTICED THAT ON ANDROID LINUX THE RESTART SERVICE SSHD COMMAND DOES NOT WORK. JUST STOP LINUX IN LINUX DEPLOY APP AND RESTART INSTEAD. NOW I AM SSHed FROM WINDOWS 10 INTO MY OLD NOTE 3. THINKING ABOUT ADDING IT TO A BEOWULF CLUSTER. XD !!! guide for adding root to ssh credit: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/V2V_Guide/Preperation_Before_the_P2V_Migration-Enable_Root_Login_over_SSH.html |
ssh as root doesn't fix |
i always run as root. im just careful. XD |
Also I can actually ssh in now and actually do stuff. Before I had to do everything in the terminal emulator after launching the shell. was very frustrating. also not useful for a cluster in that state. |
I had the same issue with my S7. And I must note that connecting as root solved the problems only to a certain extent. For example, "apt install hugs" failed during installation because some security context could not be set. I can no longer reproduce it, but it seemed as if shells spawned from a root shell didn't inherit their permissiveness. (SuperSU makes root shells permissive, assuming that doesn't add rights root couldn't obtain anyway). The solution was to install a kernel with SELinux set to permissive like the one below. |
Yea. You have to make serious changes to the root system structure if you are going to use it. It took me a day and a half to get IDLE2 and IDLE3 running properly under root. There are some display files and other configuration folders that are not installed in roots directory like they are for other users. But if you take your time you can make it work. I cant wait to see how it handles its place in my cluster computing chain. |
Since we're posting workarounds - put the following in your function sudo { ssh -qt root@localhost "cd '$PWD' ; \"\$@\"" "$@" ; } This is a "sudo replacement" which runs the specified command via ssh (but still in the current directory). If you don't want the password prompt, run |
Yet another workaround, add /system in custom mounts options and create a file at /usr/local/bin/sudo with the following content: #!/bin/sh /system/xbin/su -c "/data/data/ru.meefik.linuxdeploy/files/bin/linuxdeploy shell $@" |
@CyberShadow Your method sounds promising, but I'm stuck at figuring out what root password I should enter. I tried the one I supply in linuxdeploy for my user, which obviously doesn't work, and I also tried setting a password for the root user by starting a root shell in a terminal emulator (su; /data/data/ru.meefik.linuxdeploy/files/bin/linuxdeploy shell; passwd), but that password doesn't seem to do the trick either. Any pointer? |
@gfkpth I think the default password for the root user depends on your choice of distribution. It's possible that the default is that no password would work. The password would be set in |
... Well... Sudo -> permission denied. (0, -1, -1) I chrooted to root bash and tried to get somehow access with ssh keys and modified sshd_config. All settings are so contradictory. In sudoers, my user has all rights, but at the same time it has no rights. Changing roots passwd is not working because of no rights to change roots password as root. -.- sudo apt-get install kali-linux-full or apt-get upgrade-> what is that thing with selinux enforcing/passive or whatever? i dont understand what this should do, or where i see what status i got. When i look in linux-deploy -> status ... (selinux = yes) ? Changing the User to "root" in the installation config, doesn't let me even login, cause of wrong password. |
HTH! |
Flashing custom kernel fixed it on my sm-t230 |
Just would like to say thanks. @Pelphobos
Now, login to the system u installed via ssh, you can use sudo |
Hi Friend, thx for the fast response. I still cant login via ssh. (file owned by root and mod 600 + restartet service ssh) Still asks me after password. I Tried to switch to permissive mode (setenforce 1). gives me no output, but no error. half output from install full kali: Depends: wfuzz but it is not going to be installed |
I found a solution! |
I could change root password and enable root to login by ssh with talked posts. The method is chrooted and then change root password by # passwd command. |
Am I the only one that cant vim or nano over an adb shell? All I see is a bunch of garbage characters. |
I also have the sudo issue (though not with an s6); I do not want to have to flash a custom kernel to fix this, and allowing root access through ssh is a really bad idea. |
Thank you so much, this is the only thing that worked! 💖 |
I get this instead when I try:
android@Solarium:
$ sudo -s$sudo: PERM_ROOT: setresuid(0, -1, -1): Permission denied
sudo: unable to initialize policy plugin
android@Solarium:
This is after selecting Debian unstable as my environment to install.
The text was updated successfully, but these errors were encountered: