(Update 5/02/2012 0.9.4) [APP][ICS4.0.3+]OpenVPN for ICS (no root/jailbreak required) - Android Apps and Games

Note:
You can't install a pfx/p12 certification file which is not password protected, it is UNSAFE, android won't allow you do that
Please uninstall previous version first before install 0.9.0.
Due to Titanium Backup can't restore the permission to the keystore, if you are using Titanium Backup to backup/restore configurations, after a restore, please reconfigure your profile, repick the user certification to grant the permission to the keystore.
Features:
Compatible to all ICS device (NO ROOT REQUIRED, works on stock firmware)
Easy to use
Multiple VPN profile
Username/password authentication
Secure (Don't store your private key in App, but managed by Android system)
Open source
Limitation:
Only TUN mode, no TAP mode. (system API limitation)
One simultaneous connection only. (system API limitation)
ChangeLog:
5/02/2012 0.9.4
Fix redirect-gateway option
4/28/2012 0.9.3
Temporary fix tls-auth (Store tls key file in sdcard is insecure !!!)
Fix crash
4/27/2012 0.9.2
Add ns-cert-type option
Fix connection without user certification
4/25/2012 0.9.1
More error message
Fix extra arguments option
4/23/2012 0.9.0
Fix some crash
4/21/2012
Add username/password based authentication support. (Need to input password manually every time when connect)
Issues:
Connection interrupted if leave GUI while preparing/connecting. (It will be OK to leave once connected)
Won't work on JB, wait until google release openssl engine for system keystore
Screen Shots: Here
Download: Here
Source code: Here
Any feedback is welcome.

OpenVPN
Please don't retire this! people haven't stumbled on it but this is great!
The #1 reason most people root their phones even when they don't want to!

Thank you very much. I was using the one in cm7 and worked perfectly. Is there any plans to port it to cm9, this is the most missing feature for me in cm9. Thank you.

Waiting for password authentication.
Nice work anyway!

jcasares said:
Waiting for password authentication.
Nice work anyway!
Click to expand...
Click to collapse
Sure, I'm still working on it, it will be done soon. And I need to setup a test openvpn server first.

I can provide an OpenVPN connection (username and password) if required or it's too much work building a test server.

jcasares said:
I can provide an OpenVPN connection (username and password) if required or it's too much work building a test server.
Click to expand...
Click to collapse
I have already completed it, still thanks

Seems to be an issue with using the tls-auth option. It ignores the file even though the path is correct.

idmud said:
Seems to be an issue with using the tls-auth option. It ignores the file even though the path is correct.
Click to expand...
Click to collapse
I haven't test this feature before, maybe I should migrate this with the new keystore API.

can't select trusted CA
When I select my CA nothing changes so I'm not sure if it registers the certificate in the connection.
When I hit connect the icon flashes in the notification area and disappears.
I have tried the CA certificate in both .pem and .crt formats
Log says: No log.
Am running CM9 on AT&T Nexus S.

config request
Hi! Thanks for your great work!!!
Could you please add a simple checkbox in the connection settings to make the option "--ns-cert-type server" optional?

omriasta said:
When I select my CA nothing changes so I'm not sure if it registers the certificate in the connection.
When I hit connect the icon flashes in the notification area and disappears.
I have tried the CA certificate in both .pem and .crt formats
Log says: No log.
Am running CM9 on AT&T Nexus S.
Click to expand...
Click to collapse
Both .pem and .crt is pem format, where the content should be enclosed between "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----", you can use any text editor like notepad to check it.
I'll make the error message more verbose and accurate. Before that, can you use `adb logcat` to check if there is any error message ?

zealot0630 said:
Both .pem and .crt is pem format, where the content should be enclosed between "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----", you can use any text editor like notepad to check it.
I'll make the error message more verbose and accurate. Before that, can you use `adb logcat` to check if there is any error message ?
Click to expand...
Click to collapse
I know they are the same but for some reason the android store will only load .crt files.
The certificate begins and ends as mentioned.
I will try to run a logcat tomorrow.
Sent from my Nexus S using XDA

hamster79 said:
Hi! Thanks for your great work!!!
Could you please add a simple checkbox in the connection settings to make the option "--ns-cert-type server" optional?
Click to expand...
Click to collapse
I have fixed 'Extra arguments' option in 0.9.1, please update and you'll be able to specify custom options.

I have a working OpenVPN server with PCs and Android devices connecting to it.
Here is the situation with ICS.
I have installed this OpenVPN for a friend running ICS Midnote 3.3 for his Samsung Galaxy Note. Unfortunately, I can't get it to work, the logs does not display anything. It goes on stating its preparing and does not do anything else.
I tried forcing it to write any logs by supplying log /sdcard/openvpn/log.txt under the parameter section.
My currently VPN settings include.
Ca.crt, username and password. No keys are supplied.
To isolate things, I tried it with DroidVPN client, which works but is painstakingly slow.
You assistance is highly appreciated.
Thank you.

jaidee said:
I have a working OpenVPN server with PCs and Android devices connecting to it.
Here is the situation with ICS.
I have installed this OpenVPN for a friend running ICS Midnote 3.3 for his Samsung Galaxy Note. Unfortunately, I can't get it to work, the logs does not display anything. It goes on stating its preparing and does not do anything else.
I tried forcing it to write any logs by supplying log /sdcard/openvpn/log.txt under the parameter section.
My currently VPN settings include.
Ca.crt, username and password. No keys are supplied.
To isolate things, I tried it with DroidVPN client, which works but is painstakingly slow.
You assistance is highly appreciated.
Thank you.
Click to expand...
Click to collapse
Would you please try this one , see if it works

zealot0630 said:
Both .pem and .crt is pem format, where the content should be enclosed between "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----", you can use any text editor like notepad to check it.
I'll make the error message more verbose and accurate. Before that, can you use `adb logcat` to check if there is any error message ?
Click to expand...
Click to collapse
Double checked and there were a few characters before "begin certificate ". Removed them and the certificate loads(the app should ignore any text before/after those words). Still wouldn't connect and nothing in the log.
Just tried 0.9.2 and the log now says:
1335355150,D,MANAGEMENT: CMD 'state on all'
1335355150,D,MANAGEMENT: CMD 'hold release'
1335355150,D,MANAGEMENT: CMD 'username 'Auth' "xxxxxx"'
1335355150,D,MANAGEMENT: CMD 'password [...]'
Sent from my Nexus S using XDA

It seems that it doesn't work and I'm not clear about what the issue is. I'm using user+password authentication.
Code:
W/info.kghost.android.openvpn.OpenVpnService( 3856): Error generate pkcs12
W/info.kghost.android.openvpn.OpenVpnService( 3856): java.lang.NullPointerException: alias == null
W/info.kghost.android.openvpn.OpenVpnService( 3856): at android.security.KeyChain.getPrivateKey(KeyChain.java:291)
W/info.kghost.android.openvpn.OpenVpnService( 3856): at info.kghost.android.openvpn.OpenVpnService$Task.prepare(OpenVpnService.java:123)
W/info.kghost.android.openvpn.OpenVpnService( 3856): at info.kghost.android.openvpn.OpenVpnService$Task.doInBackground(OpenVpnService.java:313)
W/info.kghost.android.openvpn.OpenVpnService( 3856): at info.kghost.android.openvpn.OpenVpnService$Task.doInBackground(OpenVpnService.java:44)
W/info.kghost.android.openvpn.OpenVpnService( 3856): at android.os.AsyncTask$2.call(AsyncTask.java:264)
W/info.kghost.android.openvpn.OpenVpnService( 3856): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/info.kghost.android.openvpn.OpenVpnService( 3856): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/info.kghost.android.openvpn.OpenVpnService( 3856): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
W/info.kghost.android.openvpn.OpenVpnService( 3856): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
W/info.kghost.android.openvpn.OpenVpnService( 3856): at java.lang.Thread.run(Thread.java:856)
D/dalvikvm( 2108): GC_CONCURRENT freed 433K, 28% free 10263K/14151K, paused 2ms+3ms
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): alias == null
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): java.lang.NullPointerException: alias == null
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at android.security.KeyChain.getPrivateKey(KeyChain.java:291)
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at info.kghost.android.openvpn.OpenVpnService$Task.prepare(OpenVpnService.java:123)
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at info.kghost.android.openvpn.OpenVpnService$Task.doInBackground(OpenVpnService.java:313)
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at info.kghost.android.openvpn.OpenVpnService$Task.doInBackground(OpenVpnService.java:44)
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at android.os.AsyncTask$2.call(AsyncTask.java:264)
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
F/info.kghost.android.openvpn.OpenVpnService$Task( 3856): at java.lang.Thread.run(Thread.java:856)
Maybe you know why the alias==null happens.

Seems there are still some problem when user certification is not set. I'll figure it out soon.

This is what I got now after installing the new version. The application doesn't stay in the notification bar as before and it seems there is no connection to the OpenVPN network.
Code:
D/PackageManager( 2000): New package installed in /mnt/asec/info.kghost.android.openvpn-1/pkg.apk
D/BackupManagerService( 2000): Received broadcast Intent { act=android.intent.action.PACKAGE_ADDED dat=package:info.kghost.android.openvpn flg=0x10000010 (has extras) }
I/ActivityManager( 2000): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=info.kghost.android.openvpn cmp=info.kghost.android.openvpn/.VpnSettings} from pid 12559
I/ActivityManager( 2000): Start proc info.kghost.android.openvpn for activity info.kghost.android.openvpn/.VpnSettings: pid=12965 uid=10087 gids={3003}
D/dalvikvm(12965): Trying to load lib /mnt/asec/info.kghost.android.openvpn-1/lib/libjni_openvpn.so 0x41357cc8
D/dalvikvm(12965): Added shared lib /mnt/asec/info.kghost.android.openvpn-1/lib/libjni_openvpn.so 0x41357cc8
D/dalvikvm(12965): No JNI_OnLoad found in /mnt/asec/info.kghost.android.openvpn-1/lib/libjni_openvpn.so 0x41357cc8, skipping init
I/ActivityManager( 2000): Displayed info.kghost.android.openvpn/.VpnSettings: +378ms
I/ActivityManager( 2000): START {cmp=info.kghost.android.openvpn/.VpnEditor (has extras)} from pid 12965
I/ActivityManager( 2000): Displayed info.kghost.android.openvpn/.VpnEditor: +263ms
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >INFO:OpenVPN Management Interface Version 1 -- type 'help' for more info
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: real-time echo notification set to ON
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: END
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: real-time log notification set to ON
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367061,I,OpenVPN 2.2.2 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] [eurephia] built on Apr 25 2012
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367061,,MANAGEMENT: unix domain socket listening on /data/data/info.kghost.android.openvpn/cache/manage
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367061,,Need hold release from management interface, waiting...
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367062,,MANAGEMENT: Client connected from /data/data/info.kghost.android.openvpn/cache/manage
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367062,D,MANAGEMENT: CMD 'echo on all'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367062,D,MANAGEMENT: CMD 'log on all'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: END
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >LOG:1335367062,D,MANAGEMENT: CMD 'state on all'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: real-time state notification set to ON
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367061,CONNECTING,,,
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: END
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >LOG:1335367062,D,MANAGEMENT: CMD 'hold release'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: hold release succeeded
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >LOG:1335367062,D,MANAGEMENT: CMD 'username 'Auth' "jcasares2"'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: 'Auth' username entered, but not yet verified
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >LOG:1335367062,D,MANAGEMENT: CMD 'password [...]'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: 'Auth' password entered, but not yet verified
I/ActivityManager( 2000): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=info.kghost.android.openvpn/.VpnSettings} from pid 2256
I/ActivityManager( 2000): Displayed info.kghost.android.openvpn/.VpnSettings: +205ms
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >INFO:OpenVPN Management Interface Version 1 -- type 'help' for more info
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: real-time echo notification set to ON
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: END
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: real-time log notification set to ON
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367167,I,OpenVPN 2.2.2 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] [eurephia] built on Apr 25 2012
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367167,,MANAGEMENT: unix domain socket listening on /data/data/info.kghost.android.openvpn/cache/manage
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367167,,Need hold release from management interface, waiting...
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367168,,MANAGEMENT: Client connected from /data/data/info.kghost.android.openvpn/cache/manage
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367168,D,MANAGEMENT: CMD 'echo on all'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367168,D,MANAGEMENT: CMD 'log on all'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: END
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >LOG:1335367168,D,MANAGEMENT: CMD 'state on all'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: real-time state notification set to ON
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: 1335367167,CONNECTING,,,
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: END
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >LOG:1335367168,D,MANAGEMENT: CMD 'hold release'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: hold release succeeded
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >LOG:1335367168,D,MANAGEMENT: CMD 'username 'Auth' "jcasares2"'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: 'Auth' username entered, but not yet verified
I/info.kghost.android.openvpn.OpenVpnService$Task(12965): >LOG:1335367168,D,MANAGEMENT: CMD 'password [...]'
W/info.kghost.android.openvpn.OpenVpnService$Task(12965): Unknown Command: SUCCESS: 'Auth' password entered, but not yet verified

Related

[Q]Giving dhcpd more permisons to run custom hooks script

I'm searching for an way to give dhcpd process more permissions. I will to add a custom script to dhcdp-hooks. For test I have add to 95-configured this line:
Code:
log $(touch /sdcard/test2 2>&1)
log $(touch /data/misc/dhcp/test2 2>&1)
log $(arp -s 192.168.0.0 54:e6:fc:e9:f8:11 2>&1)
And in logcat I am getting:
Code:
I/log ( 6260): touch: /sdcard/test2: Permission denied
I/log ( 6266): arp: SIOCSARP: Operation not permitted
Only /data/misc/dhcp/test2 works because this folder is owned by dhcp. I will to run arp command (this arguments are only for example) after connecting to a network. Any way to do this without recompiling the complete Android rom, I know that the UID are hard coded in Android code. Another way is getting libcap working on Android, but I can't found any info about this. I have try to put line like this:
Code:
log $(su -c 'arp -s 192.168.0.0 54:e6:fc:e9:f8:11' 2>&1)
But then dhcpd stuck and I can't connect to my network.

[Q] Issues Rooting Motorola Photon 4G

http://forum.xda-developers.com/showthread.php?t=1819660 Followed instructions here, no joy. Log following.
Notes: It detects busybox is running and wants me to clean, I take option 2 as detailed in the instructions and it proceeds to run option one. When I hit the second step in the commands to run (./photon-torpedo.sh) it gives me this error:
Unfortunatly your going have to enter some shell commands here
Not to worry though it only five commands press enter after each one
1 -- Enter at the first $ cd /data/tmp
2 -- Enter at the second $ ./photon-torpedo.sh
3 -- Enter at the first # ./kill-su.sh
4 -- Enter at the second # exit
5 -- Enter at the next $ exit
Once you are done the script will finish up and reboot your phone.
$ cd /data/tmp
cd /data/tmp
$ .photon-torpedo.sh
.photon-torpedo.sh
.photon-torpedo.sh: not found
$ ./photon-torpedo.sh
./photon-torpedo.sh
ERROR: ld.so: object 'libpcprofile.so' cannot be loaded as audit interface: unde
fined symbol: la_version; ignored.
Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
ddxSigGiveUp: Closing log
./photon-torpedo.sh: line 5: /lib/libphoton-torpedo.so: Permission denied
ERROR: ld.so: object 'libphoton-torpedo.so' cannot be loaded as audit interface:
invalid ELF header; ignored.
Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
ddxSigGiveUp: Closing log
$
-Fails to give root access while running the torpedo as far as I can tell.
(would post to the thread this pertains to but I do not have enough posts to do so apparently)
In addition: this was previously rooted on a older version of the firmware, which one I cannot remember. Current BusyBox is 1.17.1 su is running binary v3.0(11) permissions are -rwxr-xr-x rootshell /system/bin/su

[Guide] How To Logcat

I think this one is definitely needed for this forum as i am seeing more and more users ask how to logcat. So posting this here.
Here's how to use logcat:
There are two main ways to do a logcat, within android, and through adb.
Logcat within android can be done one of two ways, through a Logcat app:
Here are two good examples are either: aLogcat or Catlog
I prefer catlog, because in my opinion it has a little bit nicer UI. Both of these programs can dump their logs to a txt file, which is very useful for debugging. Or, you can do it in terminal emulator (same rules as running through adb(see below))
From Moscow Desire:
On the other hand, using adb to run logcat, in my opinion is much more useful, because you can start using it when android boots (i.e. once the boot animation appears.)
The code for logcat to output to a file is
Code:
adb logcat > name of problem.txt
you can also do
Code:
adb logcat -f name of problem.txt
how I prefer to do it is this way:
Code:
adb logcat -v long > name of problem.txt
with the -v flag & the long argument, it changes output to long style, which means every line of logcat will be on its own line (makes it a little neater, imo)
Note: When outputting to a file, you will see a newline, but nothing printed, this is normal. To stop logcat from writting to a file, you need to press ctrl+c.
Here's where using logcat (via adb makes life really easy)
Lets say you find a problem you're having after looking at a logcat.
For example:
When I was trying to use a different ramdisk, wifi wouldn't work so I got a logcat that's almost 1300 lines long (a lot of stuff happens in the background)
So if you are searching for an error in the logcat file (it's always e/ for error, f/ for fatal. Those are the two main things that will break a system.)
Code:
D/dalvikvm( 871): GC_CONCURRENT freed 472K, 6% free 10224K/10823K, paused 1ms+6ms
V/AmazonAppstore.DiskInspectorServiceImpl( 871): Available blocks: 21981, Block size: 4096, Free: 90034176, Threshold: 5242880, withinThreshold? true
D/AmazonAppstore.UpdateService( 871): Received action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
W/AmazonAppstore.UpdateService( 871): Confused about why I'm running with this intent action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
D/dalvikvm( 890): GC_CONCURRENT freed 175K, 4% free 9375K/9671K, paused 2ms+3ms
V/AmazonAppstore.ReferenceCounter( 871): Reference (MASLoggerDB) count has gone to 0. Closing referenced object.
E/WifiStateMachine( 203): Failed to reload STA firmware java.lang.IllegalStateException: Error communicating to native daemon
V/AmazonAppstore.UpdateService( 871): runUpdateCommand doInBackground started.
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateCommand( 871): Not updating key: digitalLocker from: 1334228488057
V/AmazonAppstore.UpdateService( 871): Finished UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: serviceConfig
V/AmazonAppstore.MASLoggerDB( 871): performLogMetric: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
V/AmazonAppstore.MASLoggerDB( 871): onBackgroundTaskSucceeded: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
W/CommandListener( 118): Failed to retrieve HW addr for eth0 (No such device)
D/CommandListener( 118): Setting iface cfg
D/NetworkManagementService( 203): rsp
D/NetworkManagementService( 203): flags
E/WifiStateMachine( 203): Unable to change interface settings: java.lang.IllegalStateException: Unable to communicate with native daemon to interface setcfg - com.android.server.NativeDaemonConnectorException: Cmd {interface setcfg eth0 0.0.0.0 0 [down]} failed with code 400 : {Failed to set address (No such device)}
W/PackageParser( 203): Unknown element under : supports-screen at /mnt/asec/com.android.aldiko-1/pkg.apk Binary XML file line #16
D/wpa_supplicant( 930): wpa_supplicant v0.8.x
D/wpa_supplicant( 930): random: Trying to read entropy from /dev/random
D/wpa_supplicant( 930): Initializing interface 'eth0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
D/wpa_supplicant( 930): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): ctrl_interface='eth0'
D/wpa_supplicant( 930): update_config=1
D/wpa_supplicant( 930): Line: 4 - start of a new network block
D/wpa_supplicant( 930): key_mgmt: 0x4
(mind you, that's 29 lines out of 1300ish, just for example)
I then could do the following with logcat:
Code:
adb logcat WifiStateMachine:E *:S -v long > name of problem.txt
and this will only print out any errors associated with WifiStateMachine, and anything which is fatal, which makes it about a million times easier to figure out what's going on!
In WifiStateMachine:E, the :E = to look for Errors, the full list of options is as follows:
V — Verbose (lowest priority)
D — Debug
I — Info (default priority)
W — Warning
E — Error
F — Fatal
S — Silent (highest priority, on which nothing is ever printed)
You can replace the :E with any other letter from above to get more info.
In order to filter out anything other than what you are looking for (in this case, WifiStateMachine) you must put a *:S after your last command (i.e. WifiStateMachine:E ThemeChoose:V ... ... AndroidRuntime:E *:S)
Sources: http://developer.android.com/tools/help/logcat.html
http://developer.android.com/tools/help/adb.html
Update for windows users:
Thank go to FuzzyMeep Two, Here's what he's posted for windows
(If you used his tool, here's his post, thank him for his work!)
Note : I am just sharing. Original post here.
Good work, Khizar. A very handy and usefull guide. Thanks.
Perfect idea! Very good guide!!! As usual! Amazing job, my friend!
Sent from my SM-G900F using Tapatalk
Pierre118 said:
Good work, Khizar. A very handy and usefull guide. Thanks.
Click to expand...
Click to collapse
daxgirl said:
Perfect idea! Very good guide!!! As usual! Amazing job, my friend!
Sent from my SM-G900F using Tapatalk
Click to expand...
Click to collapse
Thank you both but JFYI this isn't my work. I shared this guide on my previous phone and since it's so good and there is ALOT of need I shared it here as well. I mentioned that in the OP.
Sent From My SM-N9005 To All You Wonder Nobodies!!
Due to the lack of mods, trolls can ruin the XDA forum's. Don't feed them...Instead report them.
Click to expand...
Click to collapse
daxgirl said:
Perfect idea! Very good guide!!! As usual! Amazing job, my friend!
Sent from my SM-G900F using Tapatalk
Click to expand...
Click to collapse
agree !
Khizar said:
Thank you both but JFYI this isn't my work. I shared this guide on my previous phone and since it's so good and there is ALOT of need I shared it here as well. I mentioned that in the OP.
Sent From My SM-N9005 To All You Wonder Nobodies!!
Click to expand...
Click to collapse
Though not pure your own work, but noobies will need it, especially to send a log back to devs to know what is the problem.
And it's a good thing to share here.
:good:
antique_sonic said:
agree !
Though not pure your own work, but noobies will need it, especially to send a log back to devs to know what is the problem.
And it's a good thing to share here.
:good:
Click to expand...
Click to collapse
Appreciate the support brother...
Sent From My SM-G900F-Morphed SM-N9005 With XNote Goodness To All You Wonder Nobodies!!
Due to the lack of mods, trolls can ruin the XDA forum's. Don't feed them...Instead report them.
Click to expand...
Click to collapse
Khizar said:
Appreciate the support brother...
Sent From My SM-G900F-Morphed SM-N9005 With XNote Goodness To All You Wonder Nobodies!!
Click to expand...
Click to collapse
No worries Bro.
Sent from somewhere under the sky, at the corner of this rounded earth.
Great idea bro. We finally have a proper logcat thread for our Note3. ?
Sent from my SM-G900F using Tapatalk
fahadali2315 said:
Great idea bro. We finally have a proper logcat thread for our Note3. ?
Sent from my SM-G900F using Tapatalk
Click to expand...
Click to collapse
:good:

[MOD][TOOL] Flashable Persistent SSH Server (PDSSHD)

Code:
[COLOR="Red"]echo "The usual... STOP! READ ALL OF THIS POST BEFORE CONTINUING TO INSTALL:
I WILL NOT BE HELD RESPONSIBLE FOR LOSS OF DATA, LOSS OF ROOT ACCESS, BRICKED DEVICES,
CRY BABIES, TEMPER TANTRUMS RESULTING IN SMASHED DEVICES OR ANY OF THAT NOISE. MAKE A BACKUP!!!"[/COLOR]
PERSIST DROID SSHD - The persistent lil SSH server
I've modified an SSH server/daemon to install to /system using a .zip, start on boot and even function after the phone has been wiped of it's user data (think anti-theft). Because dropbear is executed with root UID some ROMs even allow for removal su binaries and app while maintaining root shell /filesystem access on device through SSH.
Click to expand...
Click to collapse
FEATURES
- Automatic start on boot
- Dropbear & Openssh
- User data wipe survival
- ROM update survival
- Automatic reverse ssh tunnel
- Automatic http tunnel
- Automatic DDNS
- Runs as root even without SU on most roms
- Wakelock on connect
- Notification on connect
- Lightweight & battery friendly
- 64bit compatibility
Click to expand...
Click to collapse
Prerequisites & Installation Instructions :good:
Prereqs
- Initial root access/write access to /system
- Android Terminal Emulator, ADB shell or an SSH server installed from app store.
- Ability to write to /system or flash .zips
- Busybox installed (comes with most roms)
- BASH in /system/xbin (comes with most roms that include busybox)
- init.d or su.d support (currently uses su.d)
- Custom Recovery clockworkmod 5 based for .zip install
- dm-verity removed from kernel
Instruct
1. Install .zip via recovery (CWM or TWRP)
2. Reboot phone
3. Run 'pdsshd -h' via Terminal Emulator, ADB or SSH client.
USAGE EXAMPLE:
Code:
[email protected] # pdsshd -h
PDSSHD v2.08 by:
[email protected] forums
Available options:
-a configures AIO
-b config BACKUP
-s configures SSH
-r configures REVERSE SSH
-p configures HTTP SOCKS PROXY
-d configures DDNS
-k configures SSH KEYS
-e executes enabled SERVICES
-c checks running SERVICES
-h displays this HELP message
-u uninstalls PDSSHD
[email protected] # pdsshd -a
PDSSHD v2.08 by:
[email protected] forums
---ENTER-CURRENT-PASS---
Please press ENTER to continue
---CONFIGURE-SSH-DAEMON---
Enter new password:
password written
Enter new port: 22
port set
Enable SSH? y
Reverse SSH enabled
Enable Wakelock on Connect? y
Wakelock enabled
Enable Notification on Connect? y
Notification enabled
---CONFIGURE-REVERSE-SSH---
Enter reverse listen port: 20002
port set
Enter remote server: yourserver.com
server set
Enter remote serv port: 22
port set
Enter remote username: geofferey
username set
Enter path to remote private key: /sdcard/.ssh/netlab-key
---CONVERTING-PRIVATE-KEY---
mkdir: '/system/etc/.ssh': File exists
mkdir: '/sdcard/.ssh': File exists
TRACE (5097): enter buf_get_priv_key
TRACE (5097): enter rsa_key_free
TRACE (5097): leave rsa_key_free: key == NULL
TRACE (5097): enter buf_get_rsa_priv_key
TRACE (5097): enter buf_get_rsa_pub_key
TRACE (5097): leave buf_get_rsa_pub_key: success
TRACE (5097): leave buf_get_rsa_priv_key
TRACE (5097): leave buf_get_priv_key
Key is a RSA key
TRACE (5097): enter buf_put_priv_key
TRACE (5097): type is 1
TRACE (5097): enter buf_put_rsa_priv_key
TRACE (5097): enter buf_put_rsa_pub_key
TRACE (5097): enter buf_putmpint
TRACE (5097): leave buf_putmpint
TRACE (5097): enter buf_putmpint
TRACE (5097): leave buf_putmpint
TRACE (5097): leave buf_put_rsa_pub_key
TRACE (5097): enter buf_putmpint
TRACE (5097): leave buf_putmpint
TRACE (5097): enter buf_putmpint
TRACE (5097): leave buf_putmpint
TRACE (5097): enter buf_putmpint
TRACE (5097): leave buf_putmpint
TRACE (5097): leave buf_put_rsa_priv_key
TRACE (5097): leave buf_put_priv_key: rsa done
Wrote key to '/system/etc/.ssh/reverse_ssh_key'
TRACE (5097): enter sign_key_free
TRACE (5097): enter dsa_key_free
TRACE (5097): enter dsa_key_free: key == NULL
TRACE (5097): enter rsa_key_free
TRACE (5097): leave rsa_key_free
TRACE (5097): leave sign_key_free
Enable Reverse SSH? y
Reverse SSH enabled
---CONFIGURE-HTTP-PROXY---
Enter socks listen port: 8080
port set
Enable HTTP SSH? y
HTTP SSH enabled
--CONFIGURE-DDNS--
Enter username: geofferey
user set
Enter password: yourpassword
pass set
Enter alias: no-ip.yourdomain.org
alias set
Enter provider: no-ip
provider set
Enable DDNS? y
DDNS enabled
---REMOVE-OLD-KEYS---
Remove old key(s)? y
Removing old key(s)
---GENERATING-RSA-KEY---
Will output 1024 bit rsa secret key to '/etc/dropbear/dropbear_rsa_host_key'
Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgwCUFhRlPbk+prn2pE3x9wSwf8FSbHlG2L2cLtzfKgNMUMVZdOtYgoWr3GZWdHCCJi9PuAjjZ+94Z+NGeV1KRyb92Zd1SEOUxy7uRCS7KLRBthAvZb4kpQyw5SpypCBX5Qm3HeS590WiwNguWs8UDMxJAb0FxiBbL1+ldVbwAEYIiGoP @localhost
Fingerprint: md5 7c:46:f5:d3:fe:4b:9f:73:df:4d:a8:59:10:14:78:a8
---GENERATING-DSS-KEY---
Will output 1024 bit dss secret key to '/etc/dropbear/dropbear_dss_host_key'
Generating key, this may take a while...
Public key portion is:
ssh-dss AAAAB3NzaC1kc3MAAACBAKe8fgQ/N3cxbgbFHE/trk62gAyUtD/BqDIaRFZAqiLNN3Sl3Bl+EKLLbGL6mt8TuAiLecOsRzD50kd/LwmHOFerNAcKyWjHqp53DBBcS+gYhC+9O4+X8RFDJ1AKiJAQW6YLL8LRojlUvejqhuF+g91VuW6XhBoqTQH3uaLlmyVzAAAAFQCyLaTq6QsmHV1JSbi6xA+wuyJl5QAAAIAy789AcCKHptURcd26hpHyM86CvoDV+bPzICDXzFy/Lg3coW2CpN3pCkM5Pjy37gXew/7f3okPEwwRrasqHFsZNFxhP6k9CwAcSY1dfCAAVVJDZaXtNG+xUX7fCvBNIsDCFp6WNMdW+oMOGU9itxY/amh5zGf/YIKUKnkZ6mmxFgAAAIANMETx3m54xA5N6oYpkJsUfkZC37GfouakfxNEsC71KGBDl7NSEFOEeBN6UC8ZjkrUOgBm0g1rtwwjHiujCu3XZGr+RYJ64GPGjxGqIdd2YAj3T1B7skGnNbW9ONeBRbe81t2Kr5cBwvin0O+O+GvXbpXgzH5wUun0rveMLTSZXQ== @localhost
Fingerprint: md5 a0:f1:f9:1c:40:70:a4:9e:4c:f5:8e:9c:f0:73:05:e2
---GENERATING-PRI-RSA-KEY---
Will output 1024 bit rsa secret key to '/sdcard/device-pri-key'
Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgmIfwZddTfCQXVxCVTqGAxgEGl7soS3EDsZ5ssPKMsKBIf0v+amV7REgee5AD3MGw5ZePn9C1MlIdj54XfSPws/CPe1ksQbOgN+1P3ZWapY1NkKoheppHkdYxcI6p1+cwHjitCKt+0RzS5dgcAVqZ9rZWiblakHpn1wJEXVH2jHdgzE= @localhost
Fingerprint: md5 78:1a:93:91:f3:3d:8d:94:49:42:97:99:81:ea:ef:55
---GENERATING-PUB-RSA-KEY---
---The DEVICE PRIVATE KEY located in:
/sdcard/device-pri-key is now authorized for use
---CONVERTING-RSA-KEY---
TRACE (9909): enter buf_get_priv_key
TRACE (9909): enter rsa_key_free
TRACE (9909): leave rsa_key_free: key == NULL
TRACE (9909): enter buf_get_rsa_priv_key
TRACE (9909): enter buf_get_rsa_pub_key
TRACE (9909): leave buf_get_rsa_pub_key: success
TRACE (9909): leave buf_get_rsa_priv_key
TRACE (9909): leave buf_get_priv_key
Key is a RSA key
TRACE (9909): enter buf_put_priv_key
TRACE (9909): type is 1
TRACE (9909): enter buf_put_rsa_priv_key
TRACE (9909): enter buf_put_rsa_pub_key
TRACE (9909): enter buf_putmpint
TRACE (9909): leave buf_putmpint
TRACE (9909): enter buf_putmpint
TRACE (9909): leave buf_putmpint
TRACE (9909): leave buf_put_rsa_pub_key
TRACE (9909): enter buf_putmpint
TRACE (9909): leave buf_putmpint
TRACE (9909): enter buf_putmpint
TRACE (9909): leave buf_putmpint
TRACE (9909): enter buf_putmpint
TRACE (9909): leave buf_putmpint
TRACE (9909): leave buf_put_rsa_priv_key
TRACE (9909): leave buf_put_priv_key: rsa done
TRACE (9909): enter buf_putmpint
TRACE (9909): leave buf_putmpint
TRACE (9909): enter buf_putmpint
TRACE (9909): leave buf_putmpint
TRACE (9909): enter buf_putmpint
TRACE (9909): leave buf_putmpint
Wrote key to '/sdcard/device-pri-key-openssh'
TRACE (9909): enter sign_key_free
TRACE (9909): enter dsa_key_free
TRACE (9909): enter dsa_key_free: key == NULL
TRACE (9909): enter rsa_key_free
TRACE (9909): leave rsa_key_free
TRACE (9909): leave sign_key_free
The private keys used to access this device are located on the sdcard.
Please move them to a safe location.
Configuration backed up to /data/etc
Restarting dropbear with new settings...
Check if Dropbear is running...
root 9941 1 1240 244 poll_sched 0000068240 S ./dropbear
done
Oh yeah! It's running :)
Press RETURN to continue
done
Click to expand...
Click to collapse
DOWNLOADS
XDA v2.08
GOO.IM
Click to expand...
Click to collapse
FAQ
I'm going to get this out of the way first thing. Some of it may be painfully obvious but I wanna get as many questions out of the way for those who may be inexperienced, so please bare with me.
Q. What is SSH?
A. SSH is a protocol for establishing secure communications between two computers. You can use it to send remote commands to machines, transfer files, encrypt other forms of communication & tunnel traffic to or from a remote machine. IMHO SSH is probably one of the most versatile protocols out there. If you'd like to learn more just head on over to wikipedia.
Q. I already use an SSH app on my device, what makes your mod so special?
A. That's a good question, so let me break it down... I used to use the SSH apps from the market & they're are great, but all of them lack some important features for me.
F. None of them will run after phone has been wiped of it's user data.
F. A lot of them have some kind of notification or status bar icon.
F. I haven't seen one that allows you to connect to your device when using a mobile data connection.
Q. How does all of this work?
A. It's actually pretty simple. I wrote a bash script that ask the user a series of questions then saves those answers to a file. Another set of scripts starts the server using the answers you specified as parameters. I based it in part on this guide, but my scripts handle all of the dirty work for you.
Click to expand...
Click to collapse
XDA:DevDB Information
PersistDroidSSHD, Tool/Utility for all devices (see above for details)
Contributors
Geofferey
Version Information
Status: Beta
Current Beta Version: 2.0.9
Beta Release Date: 2014-07-24
Created 2014-07-24
Last Updated 2017-03-26
RESERVED
Update!
Released ver. 2.0.9 which adds new features
including:
openssh
wakelock support
connection notification
64bit compatibility
automated private/public key generation
Rom updates (just reflash no config req)
PIE executables
Now using su.d (want init.d copy 60dropbear from su.d to init.d)
Very nice project, I'll after cleaning up my old dropbear this weekend!
I have a few questions:
Does the reverse tunnel set any kind of wakelocks? Or alarms? Or does it rely solely on Android's own network scheduler? Will it reconnect automatically?
How does the wakelock for the sshd work? Is it a full/partial wakelock set on client connect and removed when the client disconnects? Does it work with sftp too?
Thanks!
Friendly reminder:
PLEASE DIRECT QUESTIONS TO Q&A THREAD
The wake lock works by running a script that constantly checks if there is a connection established on port 22 using a while loop and some grep magic. When you disconnect the wakelock is toggled off. I don't know if it is full or partial but it keeps device from slowing to crawl when connected . I did some limited research to get it working.
Code:
#!/system/bin/sh
#Dropbear Wakelock Script by:
#[email protected] ©2015
. /system/etc/sshd.conf
sleep 10
while true; do
sleep 3
if netstat -a | grep 127.0.0.1:22 |grep ESTABLISHED >/dev/null; then
sleep 3
echo "dropbear_wakelock" > /sys/power/wake_lock
elif IP="$(ip route get 8.8.8.8 | awk '{ print $NF; exit }')" &&
netstat -a | grep $IP:22 |grep ESTABLISHED >/dev/null; then
sleep 3
echo "dropbear_wakelock" > /sys/power/wake_lock
elif netstat -a | grep 0.0.0.0:22 |grep LISTEN >/dev/null; then
sleep 3
echo "dropbear_wakelock" > /sys/power/wake_unlock
else
sleep 3
fi
done
it should work with the reverse ssh too and in my test it does
The reverse ssh tunnel uses a loop as well. Whenever the connection gets dropped it will try to re-establish automatically. I have had some minor issues with it but it gets the job done and keeps you connected minus a few rare net conditions... autossh would be better but I can't find a compiled binary for android. I'm working on that tho.
Code:
#!/system/xbin/bash
. /system/etc/sshd.conf
until ssh -N -g -T -K 180 -i "$KEYFILE" -R "$REVPORT":localhost:"$PORT" "$REMUSER"@"$REMSERV" -p "$REMSERVPORT" -y
do
sleep 1; ssh -T -i "$KEYFILE" "$REMUSER"@"$REMSERV" -p "$REMSERVPORT" -y ssh localhost -p "$REVPORT"
done
Geofferey said:
Friendly reminder:
PLEASE DIRECT QUESTIONS TO Q&A THREAD
The wake lock works by running a script that constantly checks if there is a connection established on port 22 using a while loop and some grep magic. When you disconnect the wakelock is toggled off. I don't know if it is full or partial but it keeps device from slowing to crawl when connected . I did some limited research to get it working.
Code:
#!/system/bin/sh
#Dropbear Wakelock Script by:
#[email protected] ©2015
. /system/etc/sshd.conf
sleep 10
while true; do
sleep 3
if netstat -a | grep 127.0.0.1:22 |grep ESTABLISHED >/dev/null; then
sleep 3
echo "dropbear_wakelock" > /sys/power/wake_lock
elif IP="$(ip route get 8.8.8.8 | awk '{ print $NF; exit }')" &&
netstat -a | grep $IP:22 |grep ESTABLISHED >/dev/null; then
sleep 3
echo "dropbear_wakelock" > /sys/power/wake_lock
elif netstat -a | grep 0.0.0.0:22 |grep LISTEN >/dev/null; then
sleep 3
echo "dropbear_wakelock" > /sys/power/wake_unlock
else
sleep 3
fi
done
it should work with the reverse ssh too and in my test it does
The reverse ssh tunnel uses a loop as well. Whenever the connection gets dropped it will try to re-establish automatically. I have had some minor issues with it but it gets the job done and keeps you connected minus a few rare net conditions... autossh would be better but I can't find a compiled binary for android. I'm working on that tho.
Code:
#!/system/xbin/bash
. /system/etc/sshd.conf
until ssh -N -g -T -K 180 -i "$KEYFILE" -R "$REVPORT":localhost:"$PORT" "$REMUSER"@"$REMSERV" -p "$REMSERVPORT" -y
do
sleep 1; ssh -T -i "$KEYFILE" "$REMUSER"@"$REMSERV" -p "$REMSERVPORT" -y ssh localhost -p "$REVPORT"
done
Click to expand...
Click to collapse
Sorry for a silly question, where is the q & a thread?
Sent from my A0001 using Tapatalk
Sorry for some reason I can't find the Q&A thread anymore.... There used to be a link at top of page. What's your question mate? I will answer it here. Also can you please remove the unnecessary quote from you last response to tidy things up. Thank you.
Sent from my LGMS395 using XDA Free mobile app
Try on Note 3 Lollipop
I'll try the mod, because I just upgraded my Note 3 to lollipop and had a habit of running my mobile for sftp. Now with lollipop moment it is impossible root access. See if it works.
Thank You.
Edit: I just installed the mod and these are the results, suggestions and problems I found:
Results:
Full access to all folders.
Suggestions:
1.- Although after installing the mod appears "MUST RUN 'pdsshd-toolkit' in terminal after install" Maybe people do not read and in the tutorial you indicate that you have to run "pdsshd-config"
2.- (solution to a small error): When you will run "pdsshd-config" get the following error: "pdsshd-toolkit: Permission denied." This is because the binary file "bash" has the Execute permission. My suggestion is to add to the installation script something like "set_perm (0, 0, 0500," /system /xbin /bash ");" or change permissions manually.
Problems:
1.-The sftp access does not work (which is what I am most interested).
2.-init.d not work. This will cause the kernel of my Note 3 (Civato: http://forum.xda-developers.com/galaxy-note-3/development/rom-civz-flexlollipop-rev1-2-aroma-t2987732)
NeoKbm said:
Problems:
1.-The sftp access does not work (which is what I am most interested).
2.-init.d not work. This will cause the kernel of my Note 3 (Civato: http://forum.xda-developers.com/galaxy-note-3/development/rom-civz-flexlollipop-rev1-2-aroma-t2987732)
Click to expand...
Click to collapse
1.) this is because sftp-server is not compiled with PIE support, just swap /etc/dropbear/data/br.com.bott.droidsshd/files/bin/sftp-server with my attached one.
2.) install SuperSU and move the init script to /system/su.d/10dropbear
sub77 said:
This is because sftp-server is not compiled with PIE support, just swap /etc/dropbear/data/br.com.bott.droidsshd/files/bin/sftp-server with my attached one.
Click to expand...
Click to collapse
Great find! Thanks for providing a sftp binary with PIE support. As you can see I'm not always actively updating this thread. I plan on releasing an update containing the necessary PIExecutables in near future but I can't find one for the dropbear ssh client aka dbclient. If anybody knows of a a client that was compiled with appropriate /support/flags please let me know or uploaded here.
I found a lil info on compiling with PIE support if anyone is interested. I might try it myself... MIGHT...
DISREGARD - Leaving for histroical purposes
If anybody is desperate to run PDSSHD (fully working) there is a way to bypass the requirement for PIEs by replacing /system/bin/linker with a modified one so this whole package will run on lollipop. Be weary though, you're sacrificing security for compatibility and replacing a file required by Android to properly boot. Some user have reported issues. Make a backup of /system/bin/linker first!
DISREGARD
Update:
I compiled a new working version of dbclient (first ver didn't have password access) with PIE support & attached it to this post. It will be included in the next release. PDSSHD is almost fully compatible with lollipop now I just need a PIE binary for inadyn now.
Update 2:
I uploaded a new version of my mod v2.0.6. It should be fully compatible on lollipop and probably marshmallow with the exception of inadyn. I can't figure out how to compile for android yet without ./configure...
Geofferey said:
n now.
Update 2:
I uploaded a new version of my mod v2.0.6. It should be fully compatible on lollipop and probably marshmallow with the exception of inadyn. I can't figure out how to compile for android yet without ./configure...
Click to expand...
Click to collapse
here it is, compiled without https support, so it should work with mm, too.
i used a qemu-arm chroot to compile inadyn. https://community.arm.com/groups/embedded/blog/2013/11/21/cross-compilation-for-arm
apt-get install qemu-user-static
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register
wget http://releases.linaro.org/archive/13.12/ubuntu/panda/panda-saucy_developer_20131216-558.img.gz
gunzip panda-saucy_developer_20131216-558.img.gz
fdisk -l panda-saucy_developer_20131216-558.img
# Disk panda-raring_developer_20130922-471.img: 1073 MB, 1073741824 bytes, 2097152 sectors
# Units = sectors of 1 * 512 = 512 bytes
# Sector size (logical/physical): 512 bytes / 512 bytes
# I/O size (minimum/optimal): 512 bytes / 512 bytes
# Disk label type: dos
# Disk identifier: 0x00000000
#
# Device Boot Start End Blocks Id System
# panda-raring_developer_20130922-471.img1 * 63 106494 53216 c W95 FAT32 (LBA)
# panda-raring_developer_20130922-471.img2 106496 2097151 995328 83 Linux
# Now you can see the partitions and the size information. For mounting you need the start offset of the second partition (106496) multiplied with the block size (512).
mkdir ubuntu-arm/
dd if=/dev/zero of=expand_tmp bs=1M count=3000
cat expand_tmp >>panda-saucy_developer_20131216-558.img
sudo mount -o loop,offset=54525952 panda-saucy_developer_20131216-558.img ubuntu-arm/
cp /usr/bin/qemu-arm-static ubuntu-arm/usr/bin/
resize2fs -f /dev/loop0
mount --bind /proc ubuntu-arm/proc
mount --bind /tmp ubuntu-arm/tmp
mount --bind /sys ubuntu-arm/sys
mount --bind /dev ubuntu-arm/dev
mount --bind /dev/pts ubuntu-arm/dev/pts
mount --bind /home ubuntu-arm/home
echo ubuntu-arm > ubuntu-arm/etc/debian_chroot
cp /etc/resolv.conf ubuntu-arm/etc/
chroot ubuntu-arm/
locale-gen en_US en_US.UTF-8
dpkg-reconfigure locales
echo "deb http://old-releases.ubuntu.com/ubuntu/ saucy main universe" > /etc/apt/sources.list
echo "deb-src http://old-releases.ubuntu.com/ubuntu/ saucy main universe" >> /etc/apt/sources.list
apt-get update
apt-get install nano g++ libglib2.0-dev libslang2-dev autoconf libconfuse-dev libgnutls-dev git
export PATH=/usr/local/bin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin
# git clone https://github.com/troglobit/inadyn.git
# cd inadyn
# ./autogen.sh,
break building if configure file is generated,
# ./configure --disable-ssl LDFLAGS=-static
# make && strip src/inadyn
some ideas / requests for further releases:
aroma installer to choose a dropbear or openssh deamon.
gui to configure the deamon.
ssh-copy-id support.
sshfs mount manager
cloud based backup of settings in case of a full wipe.
.
Thanks Sub, you the man! I appreciate you helping with the binaries and supporting other users in this thread. The Aroma installer is probably doable for me, problem is (correct me if I'm wrong) openssh can only use private key authentication since Android doesn't sport /etc/shadow.... I have thought of creating a GUI front end to write to the pseudo sshd.conf but I am no Java/Android app developer so that probably won't be happening unless you or someone you know is willing to tackle it. As for ssh-copy-id, sshfs and cloud based backup I will look further into it
I think I have already found some source to compile sshfs could be wrong tho.
https://github.com/l3iggs/android_external_sshfs?files=1
Sent from my Samsung Galaxy S5 using XDA Free mobile app
Hi @Geofferey,
I am new to your mod and I like it. I currently use it on my OPO, CM13 and it works quite well (ssh server only, no ddns or reverse).
Only today I was unable to connect to my device. A restart of dropbear solved my problem. So I'd suggest to add a kind of nightly restart. E.g. with cron:
http://stackoverflow.com/questions/16747880/how-to-use-crontab-in-android
In addition to this, I'd suggest a config backup in sdcard. (I use /sdcard/Android/etc for things like that. ) Because I sometimes fully wipe my device (/system, /data, /cache - but NEVER my internal SD ) to really begin from scratch. First thing I could need would be ssh. So on first start after flashing, when there is no sshd.conf, it could search in sd for it and try it with this one if present.
Good work.
Cheers,
Enkidu
Can anyone please tell me, where to place my ssh-pubkey resp. authorized_keys(2) so that I get rid of pw-login!? And what key formats are valid?
Tnx!
I found another problem:
When I reboot my device, dropbear does not work. Means, "ssh mydevice" just hangs. So port seems to be open, but dropbear is not reacting at all.
When I restart dropbear manually, all is fine.
When you reboot your device run pdsshd-toolkit -c and report back what it says.
I need openssh binary for proxy, but it seems that it was compiled without PIE support. Will not run on my Android M 6.0 Device :/ Can you please build a version with PIE support ?
thanks
Thanks for your awesome work! It looks like we also need a build for 64-bit architecture.. I'm running a CM13-NIGHTLY on a Nexus 5X.
Code:
CANNOT LINK EXECUTABLE: "/system/lib/libc++.so" is 32-bit instead of 64-bit
page record for 0x7fa4402010 was not found (block_size=32)
Connection to 10.10.10.12 closed.
I have a Nexus 5X and a S6 as well... I need to recompile for 64bit but I am lazy to attempt ATM. Sorry. I'll update when I get around to it.
So how do I uninstall it? Can I just delete a folder somewhere?

[GUIDE] Huawei usb 3g modem on android x86 4.4.2

Finally found a way to get this usb 3g modem to work with android x86. Looks like there are significant differences in android kitkat, the other tutorials didn't work for me. Here's what i did in case somebody else finds it useful:
Model: Huawei E1752 HSPA USB Stick
Android x86 4.4.2 on Acer Netbook
Get modem to work under Ubuntu first so you have chat scripts that are known to work with your modem/provider. (If having trouble finding the right AT commands to initialize your modem you can record them under windows. Try free serial port monitor)
Install PPP Widget. It doesn't work, but that gives us usb_modeswitch and pppd to play with.
Install busybox if you don't have it already. Your device should be rooted.
I disabled modem's cdrom mode so that i wouldn't have to modeswitch it with PPP Widget every time (did it from linux)
http://ma.juii.net/blog/disable-usb-mode-switching
Tweak and install pppd/chat scripts for your provider:
/sdcard/pppwidget/ppp/free-chat
Chat script to initiate connection. Change AT commands and dial number (*99#) if yours differ.
Code:
ABORT BUSY
ABORT 'NO CARRIER'
ABORT 'NO ANSWER'
ABORT DELAYED
REPORT CONNECT
TIMEOUT 2
"" AT
OK-AT-OK AT&FE0V1X1&D2&C1S0=0
OK-AT-OK AT
OK-AT-OK ATS0=0
OK-AT-OK AT
OK-AT-OK AT&FE0V1X1&D2&C1S0=0
OK-AT-OK AT
OK ATDT*99#
TIMEOUT 30
CONNECT ''
SAY '\rReport from chat:\r'
/sdcard/pppwidget/ppp/peers/free
pppd config file
Code:
#/etc/ppp/peers/free
# Usage: root>pppd call free
ttyUSB0
3600000
crtscts
connect '/data/data/de.draisberghof.pppwidget/app_bin/chat -v -f /sdcard/pppwidget/ppp/free-chat'
noauth
defaultroute
usehostname
user fooooooo
noipdefault
usepeerdns
idle 0
/sdcard/3gmodem/connect
script to start connection
Code:
#!/system/bin/sh
pppd call free
# use own DNS (OpenDNS)
ndc resolver setifdns ppp0 208.67.222.222 208.67.222.220
ndc resolver setdefaultif ppp0
To connect, open a terminal and type:
Code:
$ su
# cd /sdcard/3gmodem
# ./connect
Now you're connected. browser should work now.
Connection is there but android doesn't know about it, so apps like play store which check connectivity will think you're offline. Install Fake Wifi Connection to deal with those.
Done !
how to get chat script for other modem
Hello, Can I use your chat script with Huawei E3531, and replace only the AT commands?
Do I need busybox?
I have no knowledge of commands, just very basic commands on android terminal.
I am having a really hard time to connect to internet, mainly because Broadcom BCM43142 wifi is not compatible with android 9.0-r2, and older versions.
Thank you

Categories

Resources