Always getting "Permission denied" with "su" command on Raspberry Pi 4 (emteria.OS v11.2.0)

edited January 2022 in OS features

If I try the su command on my Raspberry Pi 4 with emteria.OS v11.2.0, then the result is always Permission denied. If I run the command through adb, then it works though, but in my case I need to execute it from out of my app. This was working fine on the Raspberry Pi 3B.

Any help appreciated.

Tagged:

Comments

  • edited July 2021

    Hi @Marlon
    With Android 11 we had to rewrite the app and the command changed to sushell. Please be cautious, root access should be avoided if possible. Can you describe what you are trying to do? Maybe there is a safer way to achieve your goal.

  • Hi @smieschek ,
    Thank you for your answer. I tried the sushell command. It indeed works. :smile:

    Our Raspberry Pi's 4 are used in an automated test environment. It's not connected to the outer world. Instead VPN is needed to access them. We need the su command to allow us the on the fly change the GPIO configuration.

  • edited April 2022

    Hi @Marlon ,
    Good to hear that it works!

    It sounds fine for your use-case, but for completeness sake I would like to add, that you could write a simple init.d script where you chmod or chown the GPIO pins with required permissions for you application. The script is automatically executed with root permissions on every boot, see https://emteria.com/kb/device-configuration-style-initd-scripts

  • In case it is of use to anyone, if you need to change the pullup/pulldown configuration of the GPIO you are configuring in init.d then you will need to use this:

    raspi-gpio set 17 pu

    example is for gpio 17

    This is an an alternative to writing something to /sys/class/gpio/gpio17 which doesn't appear to support pull/pullup/pulldown

    I would have put this on the init.d page linked above but there is not facility to add comments there

Sign In or Register to comment.