Do “adb devices”.
When it asks for permission on phone select “Always allow from this PC”, or whatever it says.
I’m not sure how this affects ADB in recovery, but it can’t hurt.
What i did in twrp was:
Ran “adb devices” on PC to check phone was detected as “Authorized”.
Opened “adb sideload” and did the slider.
Then ran “adb sideload magisk.zip” on PC.
Had magisk.zip in adb folder, but if you have adb in PATH then your terminal might be in the wrong directory. You CAN eliminate this issue by writing full path to zip or simply just check the active terminal directory.
Read more here: Source link