adb no permissions on Ubuntu 17.04

When i try:

$ adb devices

i get the result:

List of devices attached 
????????????    no permissions

what is the problem?

tried on an Ubuntu 16.04 machine and it worked perfectly. tried an 7.1.1 device and it also worked perfectly.


Solution 1:

Had same problem. Ensuring that device USB mode is NOT charging only has solved it.

Solution 2:

Try to restart the Adb server.

sudo adb kill-server

and then

sudo adb start-server

then connect your device turn Debugging on and type

adb devices