Related
Hello everyone. I'm not very experienced with Linux but have done some. I want to connect to my Tomato router using GScript and RSA keys. I generated keys with ConnectBot and I can connect to it from there fine, however when I try to connect from GScript using ssh -p port [email protected] 'command', I get an error about the host not being in the trusted hosts file. Is this because the RSA keys are not system-wide and GScript is not using what was created by ConnectBot, or is this a different unrelated problem? Any help would be great, thanks!
I really don't know where to start with this. I seriously recommend you read Wikipedia and experiment more with virtualized Linux computers (VMware Player or Oracle VirtualBox are good starts, running CentOS and Ubuntu).
RSA keys, as you're talking about at first, is the public key encryption scheme used to authenticate you to connect to your router, in this case. BUT. The keys you talk about in the second part? Those aren't keys. Your "trusted hosts file" is a list of unique fingerprints that an SSH server creates when it's first initialized, and are used to "sign" that it's the server you're connecting to.
For example, if every day you connect to the same server, and then suddenly one day, you get told that the fingerprints don't match, and you know that nothing has changed on the server end, it's a good chance that something got messed up, or that someone is attempting to perform some kind of a man-in-the-middle attack.
To get back to your question though, no, the Trusted Hosts file is not shared between ConnectBot and GScript. Odds are, ConnectBot isn't even sharing your SSH key (the RSA key) with GScript, and you haven't even gotten to that error yet. The SSH key can be system wide though (PROTIP: Just put it on the root of your SD card and load it into ConnectBot/GScript by manually adding the key file).
Thanks for your help. So basically I just want these two programs to share trusted hosts files and RSA keys. How does GScript initially come to trust a host, and how come ConnectBot didn't have this issue? I guess I could try to find the trusted hosts file ConnectBot is using, and can I move its key file to the root and then share it with GScript? Or do I need to make a new one (possibly in Cygwin on the desktop) and copy it over to the SD card.
I do plan to read more about this stuff, but that will happen in time. Right now I feel very close to accomplishing what I want (as you can probably tell by me posting this at 4:45 AM ).
Thanks again.
For the trusted hosts issue, you can't really share them, as there's no standardized format to the file (it's like trying to swap an MP3 and an AAC file; they both may be music, and they both may be of the same song, but they're quite different). There should be an option on the GScript error message to just add the host to the trusted list. If not, try running the same command from a terminal (ADB shell, or open ConnectBot and connect to local).
In regards to the key file, you'll just have to hunt down wherever ConnectBot placed it, and move it to the root of the SD card, then re-add it in ConnectBot (Press Menu and then Manage SSH keys to get to the key list. Menu again to select add/import).
Thanks. I'm having no luck finding ConnectBot's key file, so I just made a new one in Cygwin and will put it in my SD card. However I'm still not sure how to add/import that into GScript, or how to get GScript to trust that host (I don't see an option for it with the error message). These are questions I need to direct towards the GScript crowd, unfortunately its thread hasn't received much activity in awhile. Is there any other way you would go about saving a script to run from your home screen?
We all know that running "adb shell" from the command line is pretty crap, and when using a latter busybox version which has coloring support it's ultimately crap. One workaround was usually to start a telnet server on the phone, and use putty to connect to that telnet server. Actually there is a more easier way to do that which also works for non rooted phones.
Actually the Android Debug Bridge has a terminal connection feature (roughly speaking), which will be enabled after you connect to the adb server in "0006shell:" mode. You can actually use the putty to connect to this interface always, by setting the following things:
- Turn off line discipline in settings
- Use RAW mode to connect to localhost:5037
- Enter "0012host:transport-usb" (without quotes)
- Enter "0006shell:" (without quotes)
Now you've got a full fledged connection to your device. The main drawback is that it's tedious to repeat the above all the time, so I've made some modifications to the putty binary that adds a new type of connection, called "Adb"
To use the enhanced putty (via USB):
- Select Adb from the connection type list
- Enter "transport-usb" in the host (or any other connection string, check the adb socket interface documentation if you need something else than connecting via usb)
- Enter 5037 as port, if it's not already set there.
- Connect and enjoy (you might also save this connection, so next time you only have to double-click on the settings)
To use this via wireless adb:
- Connect to wireless adb using a command shell: "adb connect IPORT" (substitute ip and port for the real values)
- Enter "transport-any" in the host
- Enter 5037 as port if it's not already set there
- Connect and enjoy
To use this via the android emulator:
- Enter "transport-local" in the host. Everything else is the same
If you have multiple devices (for example multiple devices connected to usb and/or wileressly)
- Enter "transport:serial-number" in the host, where you substitute "serial-number" with the serial of the device you get by using "adb devices". Everything else is the same.
DL and source: http://github.com/sztupy/adbputty/downloads
Thanks
Great job
Love to use putty.
If this do what your say it's good buy adb shell!!
i am using putty for a long time, and i just tried urs, it looks great but i failed to connect coz i'm connecting to 2 devices....
so how can i add the -s param to specify which phone i'm gonna connect?
thx
EDIT: wow!!! i removed one of my devices and connected to it now!! ctrl-U now works!!!! THANK YOU!!!
EDIT2: quick question. if i use a normal putty, where to type in 0012transport-usb and 0006shell: ? i typed them in the term but it closed after 0006shell
Thanks. It works, but any idea how to get the up and down arrow keys to work on Putty? They work on the windows adb shell.
ykk_five said:
i am using putty for a long time, and i just tried urs, it looks great but i failed to connect coz i'm connecting to 2 devices....
so how can i add the -s param to specify which phone i'm gonna connect?
thx
EDIT: wow!!! i removed one of my devices and connected to it now!! ctrl-U now works!!!! THANK YOU!!!
EDIT2: quick question. if i use a normal putty, where to type in 0012transport-usb and 0006shell: ? i typed them in the term but it closed after 0006shell
Click to expand...
Click to collapse
The complete specification is here: http://android.git.kernel.org/?p=pl...T;hb=f41986bbc79055a4feed7266cac5c1b540296daf
This is what you can use:
- transport-any (either usb or local emulator)
- transport-usb (the only usb device)
- transport-local (the only emulator)
- transport:SERIALNUMBER (the concrete device with the appropriate serial number)
so in your case you have to use the latter.
For the second question, you need to ensure that all of the things are present:
- You are using RAW mode (connecting to localhost:5037)
- Line discipline is on "Force OFF" (in the terminal settings dialog)
- You make some pause between writing the two commands
- You don't press enter/backspace or any other key while entering the commands (the easiest way is to write the commands in eg. notepad, copy them, and paste them into putty by pressing ****+RIGHT MOUSE BUTTON)
hardcore said:
Thanks. It works, but any idea how to get the up and down arrow keys to work on Putty? They work on the windows adb shell.
Click to expand...
Click to collapse
The up and down arrow keys were actually handled by cmd.exe, which is non existent in putty. Instead it's now the responsibility of the shell to do the hard work. The included sh in the phone's sotfware (toolbox sh) is mostly useless here, but if you have busybox installed, you might want to run "busybox sh" after connecting (some rooted phones have busybox's sh as default, on them it should work out of the box).
Busybox's sh can not only handle the up and down arrows, but other things like tab completion works too.
sztupy said:
The up and down arrow keys were actually handled by cmd.exe, which is non existent in putty. Instead it's now the responsibility of the shell to do the hard work. The included sh in the phone's sotfware (toolbox sh) is mostly useless here, but if you have busybox installed, you might want to run "busybox sh" after connecting (some rooted phones have busybox's sh as default, on them it should work out of the box).
Busybox's sh can not only handle the up and down arrows, but other things like tab completion works too.
Click to expand...
Click to collapse
Use the ash.
edit:
Btw, thank you for this adb-putty.
sztupy said:
The complete specification is here: http://android.git.kernel.org/?p=pl...T;hb=f41986bbc79055a4feed7266cac5c1b540296daf
This is what you can use:
- transport-any (either usb or local emulator)
- transport-usb (the only usb device)
- transport-local (the only emulator)
- transport:SERIALNUMBER (the concrete device with the appropriate serial number)
so in your case you have to use the latter.
For the second question, you need to ensure that all of the things are present:
- You are using RAW mode (connecting to localhost:5037)
- Line discipline is on "Force OFF" (in the terminal settings dialog)
- You make some pause between writing the two commands
- You don't press enter/backspace or any other key while entering the commands (the easiest way is to write the commands in eg. notepad, copy them, and paste them into putty by pressing ****+RIGHT MOUSE BUTTON)
Click to expand...
Click to collapse
thx for u reply, but all i got in the log:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2010.10.09 13:10:54 =~=~=~=~=~=~=~=~=~=~=~=
0012transport-usb
0006shell:
FAIL0012device offline (x)
with adb turned on and working
sztupy said:
The up and down arrow keys were actually handled by cmd.exe, which is non existent in putty. Instead it's now the responsibility of the shell to do the hard work. The included sh in the phone's sotfware (toolbox sh) is mostly useless here, but if you have busybox installed, you might want to run "busybox sh" after connecting (some rooted phones have busybox's sh as default, on them it should work out of the box).
Busybox's sh can not only handle the up and down arrows, but other things like tab completion works too.
Click to expand...
Click to collapse
Yes and it will be great if busybox can handle history like linux
ADB over wireless ?
Hi, thanks for your great work
I'm using ADB Wireless
The first step is to connect first with
Code:
adb.exe connect 192.168.6.14:5555
And then the standard procedure
Is it possible for you to include these two phases directly inside Putty ?
So we just have to enter the IP address of the phone and here we go
PS : to disconnect, we have to do
Code:
adb.exe disconnect 192.168.6.14:5555
but that's not an obligation
seems to be a windows/putty problem because adb shell works wonderful on ubuntu with the default shell ...
btw. you can also easily get a sshd (dropbear) running. then you can ssh onto the device over wifi ... i can provide the binary+explanation if anybody is interested.
I'm very interested in that !
Sent from my GT-I9000 using XDA App
virus found
mathieumeuh said:
I'm very interested in that !
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
here is the explanation how to set it up (cyanogenmod wiki):
http://wiki.cyanogenmod.com/index.php?title=Howto:_Connect_to_Device_with_SSH
basically you have to create the keys on your pc and copy them onto the device. then you can connect via key-auth. if you want dropbear to autostart @boot you could add it to playlogos1 ...
and here are the binary's you need (including the missing dropbear-keygen) and a bash binary:
http://www.multiupload.com/B0L9FDQHPB
bash is optional of course but it's very nice to have tab-completion and the other improvements bash offers over sh. to replace sh with bash do the following:
Code:
cp bash /system/bin/
chmod 0755 /system/bin/bash
mv /system/bin/sh /system/bin/sh_OLD
ln -s /system/bin/bash /system/bin/sh
the chmod is really important. i forgot it once and then was unable to get shell access even over adb. was a pain in the ass to fix it again
jodue said:
seems to be a windows/putty problem because adb shell works wonderful on ubuntu with the default shell ...
btw. you can also easily get a sshd (dropbear) running. then you can ssh onto the device over wifi ... i can provide the binary+explanation if anybody is interested.
Click to expand...
Click to collapse
You seem to miss the point of this development. First, your method is mentioned as one of the possible workarounds in the first post. Second you need to have some kind of telnet/ssh server running on the phone, which you don't need, if using adb.
Meanwhile you don't even need a rooted phone or busybox or anything to get this thing working.
The main problem with adb shell under windows, that it uses the standard cmd.exe to run, and uses the standard cmd.exe's "readline" support, which only supports the up and down keys for history (and even that it only supports that within one session).
Putty is mainly the only good (xterm compatible) terminal emulator for windows (msys's or cygwin's rxvt is good too, but "adb shell" was programmed in a way that makes it kinda useless under rxvt too). There are two ways to fix this. One is to make adb.exe more comptible with rxvt, the other is to skip adb.exe entirelly and communicate with the adb server without it. This project utilises the latter.
But what is the advantage compared to "normal" ABD
But what is the advantage compared to "normal" ADB ?
Thank you!
DirkStorck said:
But what is the advantage compared to "normal" ABD
Click to expand...
Click to collapse
It has a real xterm compatible terminal emulator. Is you use busybox >= 1.17.1 you've got coloring, tab completion, resize events, keyboard events (applicatios like vi is working), etc.
This is the reason I recommend a faulty device: without the problems with the SGS the developments would go much slower Thank you for this putty, i have it connecting to the bash. Color coding and keys work perfectly.
Thanks for this Sztupy!
I hated using windows cmd.exe to access a linux shell
I've managed to build a version of wpa_supplicant that has ad-hoc enabled, by forward porting the patch in this thread:
http://forum.xda-developers.com/showthread.php?t=754961
After building and a couple of tests, it works.
To install, you need a rooted Xoom, of course, and just push the file to system/bin/wpa_supplicant.
Because zipfiles don't store permission, you have to make it executable as well.
Code:
adb remount
adb push system/bin/wpa_supplicant /system/bin/wpa_supplicant
adb shell chmod 755 /system/bin/wpa_supplicant
I also had to change the permissions on /data/misc/wifi/wpa_supplicant.conf for some reason:
Code:
adb shell chown system.wifi /data/misc/wifi/wpa_supplicant.conf
Then reboot, and try it!
It works with my Nokia N8 with JoikuSpot; I can't tether it any other way as the N8 doesn't support the PAN Bluetooth profile, and Android doesn't support DUN.
Don't forget to backup your files, and I am not liable, etc, etc.
The code I used is here:
https://github.com/kelvie/android-wpa_supplicant
Ok heres what happened to me..
I was able to push the first file and when I input the adb shell code it said the device was not connected I am rooted and had no problems rooting or access shell before
So I got a little cocky and thought that the port 5037 that adb communicates with was blocked so I typed adb tcpip 5036 to see if I could get shell access on that port well now when I type adb remount it immediately tells me error: device not found....help!
Got myself stuck without wifi (error)
Thanks for developing such a great app. If i m not wrong i think its working with all 3G carriers.
You can also turn your Motorola Xoom tablets to WiFi hotspot without rooting by enabling setting which are given here http://goo.gl/mgwdn
Also my xoom has been in debug mode and now all of a sudden I noticed that its not entering debug mode when connected there used to a little icon come up and not anymore it acts like nothing yet i can access it on my computer by going my computer and I see Xoom
Ok I got debugging mode back and xoom is plugged in now my problem is when the daemon server starts in adb shell it starts on port 5038
So when I try to copy "adb shell chmod +x /system/bin/wpa_supplicant" it still says device not found and thats if I copy and paste it exactly if I type adb shell it gives me the # Symbol then i put it "chmod +x /system/bin/wpa_supplicant" and it says bad mode
One good thing is I can now type /remount again so what I am doing wrong still stuck without wifi ;\
Ok I've tried everything except reflash my devices I've literally only been able to do step 1 which leaves me with no wifi because i cannot execute the shell commands so please a little help it's been a long night messing with this appreciate your time and I'd love to get this working!
kelvie said:
I've managed to build a version of wpa_supplicant that has ad-hoc enabled, by forward porting the patch in this thread:
http://forum.xda-developers.com/showthread.php?t=754961
After building and a couple of tests, it works.
To install, you need a rooted Xoom, of course, and just push the file to system/bin/wpa_supplicant.
Because zipfiles don't store permission, you have to make it executable as well.
Code:
adb remount
adb push system/bin/wpa_supplicant /system/bin/wpa_supplicant
adb shell chmod +x /system/bin/wpa_supplicant
I also had to change the permissions on /data/misc/wifi/wpa_supplicant.conf for some reason:
Code:
adb shell chown system.wifi /data/misc/wifi/wpa_supplicant.conf
Then reboot, and try it!
It works with my Nokia N8 with JoikuSpot; I can't tether it any other way as the N8 doesn't support the PAN Bluetooth profile, and Android doesn't support DUN.
Don't forget to backup your files, and I am not liable, etc, etc.
The code I used is here:
https://github.com/kelvie/android-wpa_supplicant
Click to expand...
Click to collapse
Ok...I tried this and got the same "bad mode" error at the
"adb shell chmod +x /system/bin/wpa_supplicant" stage.
So, I instead did "adb shell chmod 700 /system/bin/wpa_supplicant" and that was successful, so I finished the steps listed and can see my cell on my Xoom. I have a Windows Mobile 6.5 cell and my Xoom can NOW see my ad-hoc network. Thanks a lot Kelvie.
If not for the SDCard update from BRD, I think this thread would be getting alot more attention.
Not to be too mistrusting, but I am hesitant about loading this on my Xoom when it is posted by a new user with only one post.
Fusius said:
Ok...I tried this and got the same "bad mode" error at the
"adb shell chmod +x /system/bin/wpa_supplicant" stage.
So, I instead did "adb shell chmod 700 /system/bin/wpa_supplicant" and that was successful, so I finished the steps listed and can see my cell on my Xoom. I have a Windows Mobile 6.5 cell and my Xoom can NOW see my ad-hoc network. Thanks a lot Kelvie.
Click to expand...
Click to collapse
Hey that worked instantly love you!
PengLord said:
If not for the SDCard update from BRD, I think this thread would be getting alot more attention.
Not to be too mistrusting, but I am hesitant about loading this on my Xoom when it is posted by a new user with only one post.
Click to expand...
Click to collapse
I completely understand where you're coming from; but check my github repo, and google for me, I do leave a small internet trail...
I (mostly used to, don't do much anymore but answer the odd email) maintain an open source project (Basket for KDE), and try to participate in open source communities as much as I can.
I just did this to tether my Xoom Wifi to my phone, as I had no other way to get internet on the go.
Nice work. I tried to do this myself last week but ran into trouble just getting wpa_supplicant from the Android git to compile (with or without the changes)
First off, wow man thank you so much. I've been playing with this for a while and I've tried a number of different wpa supplicant files but they failed to initiate a scan of wireless networks. I just tried this one and it works great. I wanted to explain a different way to install it however for the people having ADB issues.
First you want to turn off your wifi. I have used the ADB method a couple of times but I find it easier to use Root explorer. Save the file to your Xoom, Copy it using root explorer, navigate to the system/bin folder and click mount R/W then paste the file into the folder replacing the original (make sure to make a backup!) then long hold on the file and view permissions, check all the boxes in the first two columns and the first 2 in the last column. (chmod 775) You can then restart your wifi and enjoy ad-hoc networks (no reboot needed.)
I've done this a couple of times and it works great. Thanks again.
First off, thanks a ton to the OP for getting this working!
Also, thanks to mr_wrong_0 for the root explorer directions. Not that I'm incapable of using the command prompt, it was just easier to do it this way.
mr_wrong_0 said:
First off, wow man thank you so much. I've been playing with this for a while and I've tried a number of different wpa supplicant files but they failed to initiate a scan of wireless networks. I just tried this one and it works great. I wanted to explain a different way to install it however for the people having ADB issues.
First you want to turn off your wifi. I have used the ADB method a couple of times but I find it easier to use Root explorer. Save the file to your Xoom, Copy it using root explorer, navigate to the system/bin folder and click mount R/W then paste the file into the folder replacing the original (make sure to make a backup!) then long hold on the file and view permissions, check all the boxes in the first two columns and the first 2 in the last column. (chmod 775) You can then restart your wifi and enjoy ad-hoc networks (no reboot needed.)
I've done this a couple of times and it works great. Thanks again.
Click to expand...
Click to collapse
Thanks so much for this! No issues at all. Wifi Xoom is tethered to my HTC Hero now.
Congrats on a killer mod! We are making progress nice and steady.
Installed, works great.
Thank you.
Great, thanks for your hard word.
I do have a question for those how have done this hack. I currently have an old iPhone 3g with tetherme installed and use Bluetooth tethering to give my Xoom (wifi only) internet access. This works great for me.
Is there are speed/battery life advantage to using wifi tethering instead?
Cheers
I don't know for sure. From what I understand wifi is potentially faster than bluetooth, but it can vary from device to device. I have noticed that my Epic seems to stay cooler and use less battery when broadcasting an Ad-hoc network vs broadcasting in infrastructure mode (using wifi tether 3.0.) But I've never been able to get my phone to tether with bluetooth so I don't know about battery life. One advantage of connecting over wifi is file sharing via apps like wifi file explorer. I have used that a lot to transfer files between my Xoom and my phone as well as the computer.
Noob question
Hello all,
Thank you very much for the patch.
I would like to try it out, but before that, I need to make sure of one thing;
If I root my Xoom, will I still be getting future updates from Motorola for the device if there is one? Or once I root it, is it impossible for me to update them from the manufacturer?
Thank you!
Thanks so much to the OP! I've been waiting for a reason to root my wifi Xoom. SDCard access was tempting, but I think this is the thing that pushes me over the edge!!
Thanks!!
Install openvpn and then place your edited client vpn config files and certificate files on the storage of FireTV similar to the raspberry pi method in the thread below:
h**p xbmchub.com/forums/threads/24769-How-to-set-up-your-VPN-on-raspberry-pi-using-Brain-Hornsby-Openvpn-for-XBMC
Thanks for anyone that may know more than me that could maybe get this to work...
Hmm would be nice if that worked. Did u get a chance to try it?
Sent from my Nexus 5 using XDA Free mobile app
tdfsu said:
h**p xbmchub.com/forums/threads/24769-How-to-set-up-your-VPN-on-raspberry-pi-using-Brain-Hornsby-Openvpn-for-XBMC
Click to expand...
Click to collapse
I'm working on something like this just now. Here's the thing: in my logs for the simplest openvpn app to install (not straight openvpn, it turns out, as there's a windowing issue there that makes it difficult / impossible to navigate through setup, even with a keyboard and Droidmote) once I have a config, I get errors in logcat informing me
"Your image does not support the VPNService API, sorry "
There is a manually installable openvpn binary that I've looked at a bit but not yet configured. It is going to require adding a binary to /system/xbin directly, as the installer (at least on my phone) does not understand where /system/xbin really lives and issues a remount command to a nonexistent partition.
If you're running dd-wrt or similar configurable firewall, another option is to get an account with a provider who is set up to let you do a firewall to firewall connection, and then route either all of your traffic or the traffic from your firetv through that firewall-to-firewall connection.
I have a Private Internet Access vpn account.
Installed openvpn on FireTV--
http play.google.com/store/apps/details?id=de.schaeuffelhut.android.openvpn.installer&hl=en
Installed busybox on FireTV--
http play.google.com/store/apps/details?id=stericson.busybox&hl=en
I created a pass.txt file with my PIA username on the first line and password on the second line, nothing else, then saved the file as a text file (pass.txt).
Download the following to PC--
http privateinternetaccess.com/openvpn/openvpn.zip
Extracted the zip file.
Edited the location specific .ovpn file (see below), changing the 'remote', 'ca', 'crl' and 'auth' lines to the following--
client
dev tun
proto udp
remote us-florida.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /storage/sdcard0/openvpn/ca.crt
tls-client
remote-cert-tls server
auth-user-pass /storage/sdcard0/openvpn/pass.txt
comp-lzo
verb 1
reneg-sec 0
crl-verify /storage/sdcard0/openvpn/crl.pem
Then, save the USFlorida.ovpn file.
Upload ca.crt, crl.pem, pass.txt, and .ovpn file to FireTV to /storage/sdcard0/openvpn/
Open terminal on FireTV. I use jackpal's terminal app below, but you can also use adb.
http play.google.com/store/apps/details?id=jackpal.androidterm
In terminal, type the following--
su
openvpn cd /storage/sdcard0/openvpn/USFlorida.ovpn
But I get several errors. Anyway, that's where I'm at. Maybe someone else more knowledgeable than me can figure it out. Sorry about the links, my low post-count will not allow me to post url's.
Also, you can sideload the following app to verify your external ip address, and it works great with the FireTV remote--
http play.google.com/store/apps/details?id=igit.WhatIsMyIp
The approach you've taken is where I'd be headed next on the client side.
One thing you might want to try is to do the same setup a less locked-down device and confirm that the config files work as expected there.
There's also a good discussion of the hardware approach (setting up a tunnel from your edge to a VPN provider) in the other VPN thread, http://forum.xda-developers.com/showthread.php?t=2797005
also, private internet access will sell a preconfigured router for this purpose!
In the latest 5.0.3 build for the 5T, I see dnsmasq is running in /system/bin/dnsmasq
Awesome, I want to use it. The question is, if I put my config file in /system/etc/dnsmasq.conf will dnsmasq see it and run my config? If not there, where does it need to go in order to work?
Interesting.
I'll give it a try later today.
I'd say put your configuration and see if that works. Not sure if cycling the connection would work or if you'll need a full reboot tho.
W.
Awesome, please let us know.
For those who are unfamiliar with dnsmasq, it allows users to block domains (e.g. malware.com) without having to also block all of its subdomains (e.g. www.malware.com, infect.malware.com, hidden01.malware.com, hidden02.malware.com, etc).
The /etc/hosts file commonly used to block connections cannot do this, it requires you to list every subdomain, which turns blocking sites into a game of whack-a-mole as malware sites simply invent new subdomains every day.
That's why dnsmasq is so important, and I'm glad to see that the service is running on Android.
dnsmasq is used only during tethering. Right?
Actually, you cannot find dnsmasq.conf in any directory. I think it is hard-coded in settings app.
But, you can follow these steps to use your own dnsmasq.conf
turn on tethering
kill dnsmasq
Code:
killall dnsmasq
run dnsmasq with your own configuration
Code:
dnsmasq -C /path/to/dnsmasq.conf -x /path/to/dnsmasq.pid
enjoy
This requires your device to be rooted. I use this method to host captive portal on my android device.