If you are trying to access your android mobile using “adb shell” command from host, it first starts the adb server daemon on host and then asks user to allow permissions to access device on Android mobile/device with pop-up as,
Now, by mistakenly if you didn’t allow the permissions, host command returns with “unathorized” message as below,
$ adb devices List of devices attached B2NGAA8831702707 unauthorized
Now, if you tries to check adb devices as many times, it will show the same result and Android device doesn’t show the “Allow USB debugging” message.
The solution to this is kill the adb server daemon the host using following command and use adb devices command again as,
$ adb kill-server
So, as described above, if you got any errors while connecting to device over adb, you can always try first to restart the adb server with “adb kill-server” command and then “adb start-server”