(I was transferring data to a new harddrive and in the process
I deleted my /home/me/.android/ (somewhere in \Users\me\AppData\ on windows) folder because I thought I didnt need anything in it.
Then I wanted to pull some files from my CM10.1 nightly device per adb.
It said: "error: device offline" when trying to access it.
Now, the computers adb key was gone with the userdata folder of the sdk (the .android folder) and access was denied. But somehow whatever manages the authorization questions thought that this computer was still trusted and did not ask for a new authorization.
To fix that I did the following:
delete the computers adb key: rm /data/misc/adb/adb_key on device
(I have no idea if in case of multiple authorized computers the additional keys are in a new line of the file or if they are in new files. I have only 1 computer.)
stop all adb processes "killall adb" in linuxoids and "taskkill /IM adb.exe" in windows or simply the taskmanager in both.
restart the phone
toggle usb debugging off and on
In my case it was even nastier because my sdk userdata folder ~/.android (on small ssd) was a symlink to /data/home/me/.android (on a huge drive for the emulators, android-sources and stuff)
and the symlink pointed to a nonexisting path which prevented saving any sdk settings.
On deleting the symlink or recreating the folder it should work.