English

Adb usb Missing RSA Security authorization dialog popup

usb
ubuntu
adb
lineageos
Tags: #<Tag:0x00007f9ffc590a30> #<Tag:0x00007f9ffc5908a0> #<Tag:0x00007f9ffc5906c0> #<Tag:0x00007f9ffc5904e0>

#1

Error message in the terminal when I type in the terminal ‘adb devices’:
unauthorized
The popup message to authorize the usb connection does not appear on my phone.

I use Ubuntu Linux on my pc.
I tried different usb cables.
I switched between the different usb modes (MTP, PTP)
USB Debugging is active on my phone.
I tried with another pc (that has Linux Mint installed): the popup authorization does show up on my phone.

My first investigations:
I see something interesting here: https://android.stackexchange.com/questions/71761/how-to-regenerate-create-adbkey-and-adbkey-pub-from-the-command-line
I tried this:
cedric@cedric-Fujitsu:~$ ls ~/.android/
ls: cannot open directory ‘/home/cedric/.android/’: Permission denied


#2

Looks like a problem with the setup on the Ubuntu PC. You can try either running adb as root, or changing ownership (probably) or permissions (less likely) of /home/cedric/.android (something like sudo chown -R cedric /home/cedric/.android). If you want to reset entirely, you can delete the android settings folder as root (Obligatory warning: carefull! as root you can delete your entire system) using sudo rm -r /home/cedric/.android.


#3

I’ll try it tonight. thanks.
What could have caused an ownership problem?
(I had installed adb with the following command line: $ sudo apt-get install android-tools-adb)


#4

By the way, on my other computer with Linux Mint I have installed adb the same way. However I get this instead:
$ ls ~/.android/
adbkey adbkey.pub


#5

What would be the root cause of my problem?


#6

There may be a hint if you compare the output of ll ~/.android/. Check the ownership and permissions.


#7

in Ubuntu pc:
cedric@cedric-Fujitsu:~$ ll ~/.android/
ls: cannot open directory ‘/home/cedric/.android/’: Permission denied

in Linux Mint pc:
cedric@cedric-vaio:~$ ll ~/.android/
ll: command not found
cedric@cedric-vaio:~$ ls-l ~/.android/
ls-l: command not found


#8

Here we go:
cedric@cedric-vaio:~$ ls -l ~/.android/
total 8
-rw------- 1 cedric cedric 1704 Dec 2 13:36 adbkey
-rw-r–r-- 1 cedric cedric 719 Dec 2 13:36 adbkey.pub


#9

You could try syudo on the permission denied one:
cedric@cedric-Fujitsu:~$ sudo ll ~/.android/


#10

cedric@cedric-Fujitsu:~$ sudo ll ~/.android/
[sudo] password for cedric:
sudo: ll: command not found


#11

does ls -l work with sudo?
Also, in some cases when using sudo you’ll need the full path - i.e /home/cedric/.android


#12

cedric@cedric-Fujitsu:~$ sudo ls -l ~/.android/
total 8
-rw------- 1 root root 1704 Dez 1 21:36 adbkey
-rw-r–r-- 1 root root 720 Dez 1 21:36 adbkey.pub


#13

Yep, looks like on the ubuntu machine the files were created when running as root. Unless I’m very much mistaken, those files are created by adb when adb is first run. They cannot be part of the package that is installed using apt-get, as the keys should be unique per system and per user. Hence my guess that the first time adb was started, it was started via sudo.
Using sudo, ~/ expands to home directory of the user that is calling sudo, but any files created are owned by root. You can verify this by, for example doing: sudo touch ~/filecreatedviasudo and then ls -l ~/filecreatedviasudo without sudo. It will show that the file is in your home directory, but is owned by root.
The permissions look identical, so fixing it should only require changing ownership from root to cedric (or removing the folder, and then starting adb as cedric to make it generate the required files again), as suggested a couple posts back.


#14

Indeed:
cedric@cedric-Fujitsu:~$ sudo touch ~/filecreatedviasudo
cedric@cedric-Fujitsu:~$ ls -l ~/filecreatedviasudo
-rw-r–r-- 1 root root 0 Dez 6 21:19 /home/cedric/filecreatedviasudo


#15

I changed ownership from root to cedric, as you explained, and got the popup message on my phone that I was so much looking for!
Thanks a lot! and I understood, despite knowing little about coding.