So, details would be appreciated...either here or via message...
(Here's fine, I think.)
If you've installed multiple-boot, then you shouldn't have any trouble installing the rooted copy of Android instead of the normal one. (Reflashing is very awkward, but enough has been posted elsewhere.)
Boot into Android, install
Magisk Manager, run it, and follow its instructions (which will involve a reboot). That will enable the root user.
If you haven't already, install Termux (from the Google Play store, or F-Droid or Yalp Store if you don't want to sign in). Don't bother running ‘
su root’, as that doesn't know about the special paths that Termux sets up (e.g. vim won't run). Instead, run: [blockquote]
pkg install tsu[/blockquote] Then you can use ‘
tsu’ to get a root shell. (There's no equivalent of ‘
sudo’, but ‘
tsu -s’ seems to do the job.)
The other hurdle is that by default, /system is mounted as read-only. (/etc is a link to /system/etc, so /etc/hosts is in that filesystem.) To make it writeable: [blockquote]
/system/bin/mount –o rw,remount /system[/blockquote] You can then edit /etc/hosts with vim or however else you fancy! But don't forget to make /system read-only again when you're done:
[blockquote]
/system/bin/mount –o ro,remount /system[/blockquote]
Most of the other issues I've had are to do with the unusual filesystem layout and/or permissions. I'm told that Android has some stuff from SELinux, so there are things even root can't do. Also, when run like the above, the root user has no separate home directory, so e.g. sshd complains about file permissions when run as root. (I had to configure it with
StrictModes=no, which isn't good…)
Termux has a few optional packages which can be very useful. In particular, Termux:API gives a big bunch of commands letting you access the hardware and other parts of Android: you can easily output text to speech, read in speech to text, send SMSs, make calls, show dialogs and messages, open files and URLs, take pictures, &c. And Termux:Widget lets you add shortcuts to the Android home screen which run any script you put in
.shortcuts/.
Hope that helps