[Q] Running OpenVPN and SSH via script - Android Q&A, Help & Troubleshooting

I'm looking to develop a script to do a few things:
1. Start OpenVPN
2. Wait for connection
3. SSH to a given machine using pubkey
4. Run a command on that machine
I already have OpenVPN installed and working properly. I've tried getting this working with gscript, but there seems to be a few problems:
1. When OpenVPN starts in the terminal, it doesn't release control back to the user, even with an & following the command. Though it's possible it actually does and other commands error out too fast for me to see. I've tried putting the OpenVPN start command in a separate script to call from this script, but it gives a permission denied error, even with root.
2. I cannot for the life of me find an SSH implementation for Android that will work from the command line with pubkey. I have better terminal editor pro installed, but it gives a segmentation fault when running ssh-keygen.
Does anyone know a better way of doing this?
My device is a Motorola Droid 3 running 2.3.4

Related

gps.conf

My GPS works OK only if I restart the phone with GPS enabled.
But I have still nord-america.... in system/etc/gps.conf
I was trying many methods to change this gps.conf file also root explorer.
What everything must be installed and enabled, please do not tell me just the last step.
When I was in Terminal emulator I was typing #SU and it was OK, but after typing "adb shell" I've got error message.
I have also Titanium & busy box and "USB Debug Mode" enabled, nothing works.
My root is not Writable
Hi, did you type adb shell on your phone's terminal? Then, don' do it adb is for the android sdk on the computer! what method are you doing? Maybe they were using adb to speed up the process, because typing on the terminal emulator makes any terminal typing process a nightmare...
SO: if you use terminal emulator, just type the commands for the editing,
or isntall android sdk, and you can use the adb commands
regards,
usertotya
usertotya said:
Hi, did you type adb shell on your phone's terminal? Then, don' do it adb is for the android sdk on the computer! what method are you doing? Maybe they were using adb to speed up the process, because typing on the terminal emulator makes any terminal typing process a nightmare...
SO: if you use terminal emulator, just type the commands for the editing,
or isntall android sdk, and you can use the adb commands
regards,
usertotya
Click to expand...
Click to collapse
it's enough to install SGS tools and there it's possible to switch
----psy psy----
Leave on open space and make so:
* #3214789650 #
1) Commands
2) Delete GPS data
3) TTFF test
4) Start GPS
5) wait for the termination of all operations (the button "Start GPS" again will open)
6) Back
7) Get position
8) Wait for 1-2 minutes (if will find 8 and more satelite you can interrupt)
It is more than anything in gps.conf it is not necessary to do... Satelites catches within 30 seconds...
Forget about gps.conf...
I tried a million different ways of trying to get my GPS to work and to work fast, including the methods mentioned above. I don't say that these method are ineffective, but I found them to be not effective enough. The only thing that truely made my GPS work is enabling the WiFi/GPRS support for GPS. Yeah you have to spend some traffic, but you have satelites locked in 3-5 seconds. Worth trying I think. (;

[Q] What's a good ssh server to run on the HOX+?

Any recommendations for a good ssh server to run on the phone? It's easier to me to run a shell, vi, scp via something like putty that works well as a real terminal than 'adb shell' via the command prompt where vi is all messed up, etc. I tried Android Commander as an alternative but it's too buggy at least against our phone.
So what is *the* ssh server to run on the phone with the option to keep it disabled most of the time, except when I need to use it?

Best remote shell alternative to adb shell?

What's a good approach for getting a remote shell from Windows? adb shell just doesn't cut it, I tried it from the Win command prompt and from cygwin's mintty and there are all sorts of terminal problems, cursor keys not working, escape sequences not working, vi is a mess, etc.
So what's the proper way to set up a remote shell so that you get close to the Linux experience while connecting from Windows? E.g. sshd and connect via putty, busybox installed, etc. Any recommendations please before I go and try a bunch of things and make a mess? Thanks!
sirxdroid said:
What's a good approach for getting a remote shell from Windows? adb shell just doesn't cut it, I tried it from the Win command prompt and from cygwin's mintty and there are all sorts of terminal problems, cursor keys not working, escape sequences not working, vi is a mess, etc.
So what's the proper way to set up a remote shell so that you get close to the Linux experience while connecting from Windows? E.g. sshd and connect via putty, busybox installed, etc. Any recommendations please before I go and try a bunch of things and make a mess? Thanks!
Click to expand...
Click to collapse
SSH is a good alternative. You can then connect via PUTTY from your Windos machine. There's a small ssh server for embedded system called "dropbear", alto not fully functional (no scp/sftp support), it's easier to install than openssh. If you don't want to install it in the Android OS native, you can always download an app including it, there's a few of them.
Myself I'm using openssh, using my fully GNU Debian environment (see my signature). This solution also enables me to use X-windows for remote access to my Android. But I guess this is overkill for you. But still, very cool.
kuisma said:
SSH is a good alternative. You can then connect via PUTTY from your Windos machine. There's a small ssh server for embedded system called "dropbear", alto not fully functional (no scp/sftp support), it's easier to install than openssh. If you don't want to install it in the Android OS native, you can always download an app including it, there's a few of them.
Myself I'm using openssh, using my fully GNU Debian environment (see my signature). This solution also enables me to use X-windows for remote access to my Android. But I guess this is overkill for you. But still, very cool.
Click to expand...
Click to collapse
Thanks! Your link Run a complete GNU/Linux distribution on your Android is pretty cool!
I tried DropBear SSH Server II and SSHDroid and they seem to work well enough for what I need. Next step is to get sftp working which apparently it is possible with DropBear SSH Server II with a bit of manual work.

[Q] I don't know how to set autostart sshd on boot

Hi. Im using Ubuntu Touch 13.10 pre-installed version on GNex
I don't know when is but ubuntu touch img file included openssh-server
after that ssh server doesn't automatically start
so I always have to type 'service ssh start' manually ( /etc/init.d/ssh start doesn't work )
I have tried update-rc.d ssh defaults, checked /etc/init/ssh.conf, and installed sysv-rc-conf and set run level for ssh
what's wrong? And is there anyway without adding my own script?
Try to put the command in /etc/rc.local. I can't test it because I don't have the device with me.

[Q]

Hi,
I'm trying to run a bash script on Android without root access (Nexus 4) using Terminal IDE app. Script fails with output "parent shell dies". I tried to run the same script on Ubuntu on Android phone with root access and script worked fine. In both cases I used the same version of bash shell. Does anyone know how can I solve this?

Categories

Resources