Edit: I did some deeper investigation, but still no clue what causes the problem.
adb usb error: device unauthorized. Please check the confirmation dialog... adb devices ce051605a5378d1b03 unauthorized adb connect 192.168.1.6 unable to connect to 192.168.1.6:5555
Connecting over wifi also doesn't work, that is the correct ip as I setted it fixed.
What can be the cause and how can I fix it? Running on Samsung Android 8.0 and connected to PC Win7 x64.
If you're using Windows follow these steps, after i tried every solution and almost gave up i found the following and it worked.
Windows: You'll need to have a file called adbkey.pub located at C:/users/UserAccount/.android/
Boot into recovery mode.
Open cmd and run adb devices
. It would show "recovery" instead "unauthorized".
Create a new file called adb_keys file on your PC:
type NUL > adb_keys
Now you need to copy the contents from the adbkey.pub to adb_keys, the new file you just created: adbkey.pub is located at C:/users/UserAccount/.android/ (Needless to say you need to replace "UserAccount" when running the command)
type c:\users\UserAccount\.android\adbkey.pub > adb_keys
Upload the adb_keys file to your phone:
adb push adb_keys /data/misc/adb/adb_keys
Reboot and run adb devices. It should be working now.
Thank mnoguti from this post on XDA-Developers for this answer.
If you have Linux that's the same solution with Unix commands.