Score:0

Starting ssh over usb using android reverse when device plugged in

ar flag

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?

user535733 avatar
cn flag
Did you test that the script actually runs when the phone is plugged in?
Nightmare247 avatar
ar flag
@user535733 yup, it works fine when i run it
user535733 avatar
cn flag
If the script runs when your phone is plugged in, and the script "worked perfectly", then what's your question? It's not clear.
Nightmare247 avatar
ar flag
@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
user535733 avatar
cn flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.