Adb shell su permission denied как исправить

There is an app on Google Play called ADBD Insecure by Chainfire. This app lets you run adbd in root mode if your device is rooted when running the devices Stock ROM. I just recently found out about this app.

The version on Google Play is not Free, but there is a free version available. The link to the free version is linked in the description of the application in Google Play.

What is great about this app, it works with Stock ROMs that have been rooted. If you are using a custom kernel, or a custom ROM, you probably won’t need this application. But if you are still using a stock rom, just rooted, then you may want to get this application for your device.

adbd Insecure lets you run adbd in root mode if your device is rooted.
(Note that if you are running a custom kernel, it is likely that it already implements this functionality)

If you are running a stock (made by the phone manufacturer) kernel on your device, chances are adbd is running in “secure” mode, even if you are rooted. This app lets you run adbd in “insecure” mode, which gives you root access in “adb shell”, allows access to system files and directories through “adb push/pull”, and lets you run the “adb remount” command to make your /system partition writable.

enter image description here

I have this “old” Lenovo A2107 tablet which I rooted years ago (using a download from http://androidforums.com/threads/a2107-root-mods-and-rom-discussion.661261/, tho running its root.bat script by hand from my GNU/Linux machine) and that worked fine.

Then I passed this tablet to my daughter for a couple years, and now I got it back.

/system/bin/su is still present, still the same date and size, still mode “rwsr-sr-x”, still the same firmware (Android 4.0.3) so all looks fine, but when I try to run it from a shell, it just tells me “Permission denied”.

Any idea what might be going on? What I could try to do to track it down?

Minzkraut's user avatar

Minzkraut

2,12924 silver badges31 bronze badges

asked Sep 2, 2015 at 12:27

Stefan's user avatar

4

Nowadays Magisk is commonly used for rooting.

I’ve found that on my Oneplus 5 (Oxygen OS, Nougat) it was sufficient to go to Magisk Manager app, open superuser permissions screen and toggle Shell (com.android.shell) to resolve the adb su permission denied problem.

answered Jan 28, 2018 at 15:26

Vadzim's user avatar

VadzimVadzim

24.6k11 gold badges138 silver badges151 bronze badges

3

OK, for those curious to know, I figured out what it was: the /system/bin/su program either accepts the request as-is (depending on who asks) or passes the request to some other program (Superuser.apk).

As it turns out, I still have /system/bin/su but Superuser.apk was missing. Luckily, /system/bin/su worked fine from the “adb shell”, even though it said “Permission denied” when used from ConnectBot and other terminal emulators. So I used “adb shell” to get root access and manually copied Superuser.apk into /system/apps.

d2alphame's user avatar

answered Sep 4, 2015 at 20:14

Stefan's user avatar

StefanStefan

27.8k4 gold badges52 silver badges82 bronze badges

3

FWIW… I had a similar problem ( running ‘su’ from ADB shell yielded ‘permission denied’ ), so I’ll describe my solution.

For context, I had rebrained my Galaxy Nexus with CyanogenMod.

So, I looked at the system settings, and it contains a ‘Superuser’ section; in that section’s own settings ( small menu ), there is a ‘Superuser Access’ option, which was set to ‘Apps only’. I changed that to ‘Apps and ADB’, and then I was able to start an ADB shell, and from that shell, I was now allowed to run ‘su’. 🙂

answered Mar 1, 2016 at 17:06

bernz's user avatar

bernzbernz

1556 bronze badges

9 ответов

Согласно adb help:

adb root                     - restarts the adbd daemon with root permissions

Что действительно разрешило проблему для меня.

Roman
05 июнь 2012, в 14:24

Поделиться

Без rooting. Если вы не можете подключить свой телефон, используйте команду run-as <package> для доступа к данным вашего приложения.

Пример:

$ adb exec-out run-as com.yourcompany.app ls -R /data/data/com.yourcompany.app/

exec-out выполняет команду без запуска оболочки и обработки вывода.

Fabian Zeindl
10 июль 2016, в 15:25

Поделиться

Причина отказа в доступе объясняется тем, что ваша машина Android не была правильно внедрена. Вы видели $ после запуска adb shell? Если вы правильно укоренили свою машину, вы бы увидели #.

Если вы видите $, попробуйте ввести режим суперпользователя, набрав su. Если Root включен, вы увидите # – без запроса пароля.

wind
15 авг. 2012, в 11:31

Поделиться

Возможно, вам потребуется активировать adb root из меню настроек разработчика.
Если вы запустите adb root из строки cmd, вы можете получить:

root access is disabled by system setting - enable in settings -> development options

После активации опции root (только ADB или Apps и ADB) adb перезапустится, и вы сможете использовать root из строки cmd.

Macarse
04 март 2013, в 13:14

Поделиться

Раздел data недоступен для пользователя, не являющегося пользователем root, если вы хотите получить к нему доступ, вы должны получить root права на свой телефон.

adb root не работает для всех продуктов и зависит от типа сборки телефона.

В новой версии на Android Studio вы можете исследовать /data/data path для отлаживаемых приложений.

Golil
19 дек. 2018, в 05:36

Поделиться

Будьте осторожны с косой чертой, измените “” на “/”, например:
adb.exe нажмите SuperSU-v2.79-20161205182033.apk/storage

cepix
26 дек. 2017, в 04:43

Поделиться

Запустите свой cmd как администратор, это решит мои проблемы.
Благодарю.

Kishan Oza
06 нояб. 2017, в 09:01

Поделиться

Сделайте adb remount. И затем попробуйте adb shell

Pavankumar Vijapur
13 сен. 2011, в 10:01

Поделиться

Ещё вопросы

  • 0Как показать / скрыть теги div на основе выбора радиокнопки в форме
  • 1оператор if не работает с целочисленными значениями
  • 1Vue.js: отключение кнопки на родительском компоненте в зависимости от состояния дочернего компонента
  • 1Функция re.findAll () в Python не будет работать должным образом
  • 1Создание / Получение / Извлечение нескольких фреймов данных из python-словаря фреймов данных
  • 0ограничение или скрытие php-файлов от доступа к исходному коду на локальном сервере.
  • 0_score при выполнении индексации вasticsearch
  • 0Нужен совет по созданию графически построенных чертежей с использованием Visual C ++
  • 0Как ограничить пользовательское минимальное значение размером потока менее одного бита?
  • 0Медиа-запрос css3 не работает в IE ниже ie10
  • 0Макет Dojo, абсолютная позиция
  • 0Развертывание WAR в OpenShift
  • 0Заголовок и элементы данных в одной строке, используя set_template в CodeIgniter
  • 0Возврат и передача массива для работы в C ++
  • 0Дата-Время в Qt
  • 0Как создать URL с параметрами в Laravel?
  • 0Запрос привязки данных с повторными значениями на CodeIgniter
  • 0C # (ASP .NET) исключение десериализации
  • 1Правильные типы потока при переборе элементов HTMLFormElement?
  • 0CSS кнопки не будут в центре моей навигации
  • 1Лучше ли стилизовать элемент на основе его состояния с помощью атрибута данных или класса?
  • 0ОШИБКА 1054 (42S22): неизвестный столбец «CompanyA» в «списке полей»
  • 1SimpleFactory, FactoryMethod, Абстрактная фабрика (твердый пример)
  • 1Почему StringBuilder намного быстрее, чем String
  • 0Создание функции jquery для анимации непрозрачности изображения не работает
  • 0Вызов функции-члена assign () для необъекта в smarty
  • 0Получить значение в 2D векторе с заданным ключом
  • 0jQuery Добавить элемент span в элементе абзаца, который добавляется в DOM
  • 0Фокус AngularJS после создания нового элемента
  • 1кендо чарт смена отдельных типов маркеров на одной серии
  • 1Как перебрать детей Firebase и добавить их ключи в список?
  • 1Собственный Android Inapp Покупка Где настроить лицензионный ключ RSA в кодировке Base64?
  • 0SIGBUS при уничтожении объекта с помощью std :: fstream объектов
  • 0принимая заголовок HTML к переменной javascript
  • 0Нахождение ранга булевой матрицы
  • 1Получение значения с нулем при попытке объединить orderByChild () и startAt ()
  • 0Почтовый штемпель в PHP 5: проверьте, была ли почта отклонена или была успешной
  • 1Каков наилучший алгоритм для получения повторения подстроки длины k в строке в кратчайшие сроки? [Дубликат]
  • 1Как преобразовать список из списка слов в виде строк?
  • 0Сбой wglMakeCurrent на x64
  • 0Ошибка счетчика текстовых символов при загрузке страницы
  • 0выбранный параметр не отображается в раскрывающемся списке Angularjs
  • 0Laravel 5.5 Получить порядок сообщений по сумме голосов
  • 0как предотвратить переход курсора на следующую строку в текстовой области с помощью jquery
  • 1Отправить письмо без аутентификации
  • 1Azure Blob Storage с использованием Https
  • 1Визуализация времени разработки пользовательских элементов управления в пользовательском Region / RegionManager
  • 1ValueError: недопустимый литерал для int () с основанием 10: ” при запросе ввода
  • 0Почему нельзя удалить кэш изображений в Magento 1.7.0.2
  • 0Как объявить класс с 1000000 элементов C ++

E

How it currently CAN be done
During my morning routine reading my RSS feeds, I stumbled on a review at N-Droid, discussing an app named APEFS. This app is developed by German students (hence its description on the Playstore is in German, even if you set the language to English). But for our non-German readers, a short description here:
Basically, APEFS is an alternative front-end to the Google Playstore. You browse the playstore as you do with the original app, and search it the same. But when on the results list1, an advanced filter2 comes into play:

As the second screenshot shows, you can select what permissions your wanted app is permitted to have (checkbox marked), and what permission it should not have (checkbox unchecked).
However: While this can be used to filter out apps with unwanted permissions (e.g. show only apps whitout the Internet permission), you can not restrict your results to the opposite (e.g. show only apps with Internet permission). The app clearly targets at users concerned about their privacy/security — and according to the review (I just found it a couple of minutes ago, so I could not test it yet) it does a very good job.

EDIT:
As it’s already a year ago, and the promise on the APEFS Homepage (GTransed to English, as their own English version doesn’t have that statement in the first paragraph) seems not to be fulfilled anytime soon (the app is still offline): Please consider the web-based solution from my other answer as an alternative meanwhile.

  • #1

Greetings,
My Google Pixel 6 has Busybox Pro installed and the phone is successfully rooted with Magisk 24.3, see attached screenshot.

In “adb shell” when I type “su”, “Permission denied” is returned.

How to fix, please? I need to edit the /system/etc/hosts file with my LAN entries.

Thank you.

  • rooted_pixel_6.png

    rooted_pixel_6.png

    79.2 KB

    · Views: 185

ocnbrze


  • #2

from the guide:https://forum.xda-developers.com/t/guide-root-pixel-6-oriole-with-magisk.4356233/

Points of note:

  • The boot image is NOT the bootloader image. Do not confuse the two – YOU are expected to know the difference. Flashing the wrong image to bootloader could brick your device.
  • While the Magisk app is used for patching the boot image, the app and the patch are separate. This is what you should see in Magisk for functioning root:
    screenshot_20211218-194517-png.5486339

    V0latyle · Nov 2, 2021 at 9:06 PM

    ” style=”box-sizing: border-box; display: inline-block; max-width: 100%; cursor: pointer;”>

    screenshot_20211218-194517-png.5486339

  • “Installed” shows the version of patch in the boot image. If this says N/A, you do not have root access – the boot image is not patched, or you have a problem with Magisk.
  • “App” simply shows the version of the app itself.
  • If you do not have a patched master boot image, you will need to download the factory zip if you haven’t already, extract the system update inside it, then patch boot.img.
  • If you prefer updating with the factory image, you can also extract and manually patch the boot image if desired.

does magisk show this?
“Installed” shows the version of patch in the boot image. If this says N/A, you do not have root access – the boot image is not patched, or you have a problem with Magisk.

hstroph


  • #3


does magisk show this?
“Installed” shows the version of patch in the boot image. If this says N/A, you do not have root access – the boot image is not patched, or you have a problem with Magisk.

The boot image is patched and installed according to Magisk 24.3, please see attached screenshot. Maybe there

is

a problem with that version of Magisk … can you successfully “su” with the version you’re using?

  • magisk-24.3_pixel_6.png

    magisk-24.3_pixel_6.png

    53 KB

    · Views: 138

Last edited: Apr 2, 2022

ocnbrze


  • #4

The boot image is patched and installed according to Magisk 24.3, please see attached screenshot. Maybe there

is

a problem with that version of Magisk … can you successfully “su” with the version you’re using?

sorry don’t have your phone so i can’t confirm that. you might try a different magisk…..its not a bad idea.

hstroph


  • #5

sorry don’t have your phone so i can’t confirm that. you might try a different magisk…..its not a bad idea.

I’m wondering, please, if you can successfully “su” from an “adb shell” on

whatever

phone it is that you have rooted with Magisk … or have you? I explicitly followed the recipe in the link you provided prior to my installation of Magisk, and

don’t

want to think that you just copy-n-pasted from that link without having actual experience with Magisk yourself.

From my laptop to Pixel 6 with Android 12 and Magisk 24.3

:
$ adb shell
oriole:/ $ whoami
shell
oriole:/ $ su
Permission denied
13|oriole:/ $ su –
Permission denied
13|oriole:/ $ exit
$

My previous Nexus 6P with Android 8.2 and Magisk 24.3

:
$ adb shell
angler:/ $ whoami
shell
angler:/ $ su
angler:/ # whoami
root
angler:/ # exit
angler:/ $ exit
$

Last edited: Apr 2, 2022

  • #6

Greetings,
My Google Pixel 6 has Busybox Pro installed and the phone is successfully rooted with Magisk 24.3, see attached screenshot.

In “adb shell” when I type “su”, “Permission denied” is returned.

How to fix, please? I need to edit the /system/etc/hosts file with my LAN entries.

Thank you.

Your device is not rooted correctly. Re root the device and check that the boot.img is patched correctly.

ocnbrze


  • #7

Your device is not rooted correctly. Re root the device and check that the boot.img is patched correctly.

^^^^^^ this is what i was thinking as well…..that the boot.img is either patched incorrectly or the wrong boot.img was used.

hstroph


  • #8

  1. Magisk is now uninstalled from the phone, and doesn’t appear in the list of apps on the Pixel 6.
  2. On the laptop:
    $ adb install Magisk-v24.3.apk
    Performing Streamed Install
    Success
  3. Invoking Magisk on the phone indicates that the App 24.3 (24300)(27) is installed, Magisk “Installed: NA”
  4. From the factory image, unzipping image-oriole-sp2a.220305.013.a3.zip into a tmp directory:
    $ adb push boot.img /storage/emulated/0/Download/boot.img
    boot.img: 1 file pushed, 0 skipped. 51.4 MB/s (67108864 bytes in 1.246s)
  5. In Magisk Install “Select and Patch a file”, the boot.img is selected. “LET’S GO” results in a sequence ending with the name of the patched file and “All done!”
  6. On the laptop:
    adb pull /storage/emulated/0/Download/magisk_patched-24300_jdnPc.img magisk_patched.img
    /storage/emulated/0/Download/magisk_patched-24300_jdnP…ulled, 0 skipped. 35.6 MB/s (67108864 bytes in 1.796s)
  7. $ adb reboot bootloader
    $ fastboot flash boot magisk_patched.img
    Sending ‘boot_a’ (65536 KB) OKAY [ 1.683s]
    Writing ‘boot_a’ OKAY [ 0.100s]
    Finished. Total time: 1.785s
  8. Android reboots normally. The Magisk app reports “Installed: 24.3 (24300)
  9. On the laptop:
    $ adb shell
    oriole:/ $ su
    Permission denied
    13|oriole:/ $ exit
    $
  10. Please tell me where was my rooting error. :thinking: I assure you that the correct factory boot.img was transferred to Magisk, and the correct patched *.img file was uploaded and flashed to the phone.

Last edited: Apr 3, 2022

ocnbrze


hstroph


  • #10

Yes, I downloaded the factory image and flashed the phone with it, then reconstructed my environment. The boot.img patched by Magisk is the one from that same factory image. A “Root Checker” screenshot is attached here.

The thread in the link you provided was munged and locked because the closed-source .apk carried some potentially malicious payloads.

FWIW, from “adb shell”:
1|oriole:/ $ ls -l $(which su)
lrwxrwxrwx 1 root root 8 2022-04-02 23:15 /system/bin/su -> ./magisk

oriole:/ $ ls -l $(which su) /system/bin/magisk
-rwxr-xr-x 1 root root 222928 2022-04-02 23:15 /system/bin/magisk
lrwxrwxrwx 1 root root 8 2022-04-02 23:15 /system/bin/su -> ./magisk

I’ve flashed the most recent factory image, configured everything from scratch several times, all with same result of successful Magisk installation but without “su” capability.

root_checker.png

es and installed Magisk

  • magisk_installed-1.png

    magisk_installed-1.png

    302 KB

    · Views: 131

ocnbrze


  • #11

hmmmmm i’m not sure. you might want to post this in the xda guide and see if anyone there might know of an answer……as i am stumped at this point.

hstroph


Добавить комментарий