0

I would like to execute commands on my laptop from my phone over a usb, I found from this answer that I should use adb reverse, and it worked perfectly. Now I want adb reverse tcp:8080 tcp:22 to run on it's own when I plug in my phone. For that, I referred to this and this.

I made a file in /etc/udev/rules.d/ called 85-start_ssh.rules. I made a script called start_ssh_over_usb.sh and gave it execution rights. The rules file contains this-

ACTION=="add", ATTRS{idVendor}=="2a70", ATTRS{idProduct}=="4ee7", RUN+="/path/to/my/file/start_ssh_over_usb.sh"

I got my phone's vendor id and product id with lsusb. After restarting, this still didn't seem to work. Any help?

  • Did you test that the script actually runs when the phone is plugged in? – user535733 Sep 14 '21 at 16:33
  • @user535733 yup, it works fine when i run it – Nightmare247 Sep 14 '21 at 16:45
  • If the script runs when your phone is plugged in, and the script "worked perfectly", then what's your question? It's not clear. – user535733 Sep 14 '21 at 16:47
  • @user535733 i meant, the script runs fine when i manually run it, but it doesn;t run on its own when i plug my phone in – Nightmare247 Sep 14 '21 at 16:58
  • Hence my first question, to which you responded "it works fine". You can delete comments that are confusing or incorrect. Seems like you are trying to say that plugging in the phone does NOT trigger the script. But you're not clearly saying that in either the Question or the comments. You will get better help if your Question is crystal clear, without room for guessing. – user535733 Sep 14 '21 at 16:59

0 Answers0