Hello,
As i had to Google and ask a lot about how to do this, I'm going to post here an easy and short guide to fixing your tun interface in case OpenVPN connect for example tells you that it failed to create a tun socket. Prerequisites : adb + root access.
First open cmd on Windows or terminal in linux. Navigate to your adb executable directory. Then try the following commands:
Code:
1. adb shell
2. su
3. cd /dev/tun
4. chown system tun
That's it! Now the tun should be working. If your kernel doesn't have tun.ko try TUN.ko installer on android market. It might find you tun.ko module for your kernel. If it doesn't and you are 100% sure your kernel doesn't support it try flashing a new rom with another kernel or recompile your kernel with tun support
Related
Hi guys,
I use VPNTunnel.se and want to use it on my SGS. I´m on Darkys 9.3 with Damians Ultimate kernel.
I installed OpenVPN installer and openVPN Settings, placed my openvpn.conf at sdcard/openvpn.
I can connect but www.wieistmeineip.de shows still real IP adress. What have I done wrong?
I tried out some things, but it still doesn´t work:
OpenVPN Settigs tells:
FATAL: Linux ifconfig
could not execute external program
Why does is not work??
I didtaken from other topic)
At this point, Openvpn could connect and create a tun device, but route are not pushed so it's not very usefull
So, I downloaded this version of Openvpn
http://github.com/downloads/fries/an...atic-2.1.1.bz2
As superuser
Code:
su
I remounted in rw /system
Code:
mount -o remount,rw /system
I renamed /system/xbin/openvpn into openvpn_old
Code:
mv /system/xbin/openvpn /system/xbin/openvpn_old
I put that new openvpn binary in /system/xbin
I created symlinks from /system/bin/route and ifconfig to /system/xbin
Code:
ln -s /system/bin/route /system/xbin/route
ln -s /system/bin/ifconfig /system/xbin/ifconfig
I also created a symlink os /system/xbin to /system/xbin/bb, just in case
Code:
ln -s /system/xbin /system/xbin/bb
Do some search: "enabling TUN".
GL.
I already enabled tun in recovery.
I also placed tun.ko in system/lib/modules.
Sent from my GT-I9000 using XDA App
Now I can connect,but no data is routed,because I can't replace route with busybox. Root Explorer says no free space although there are 17 MB free and when I try via terminal there is just :file exists
How can I replace a file in system/xbin?
Sent from my GT-I9000 using XDA App
Hi there!
I hope, this is the correct subforum......
Have anyone installed OpenVPN on the Galaxy S Plus I9001 any have a
good discription for me to do this?
Hope, you can help me!
Thanks for this, maze-m
Q&A section is here, please don't post questions here in development section or they will either not be answered or deleted...
Here's how I did it:
1. Root your phone using KeksFlip's excellent supereasy guide
2. Install Busybox. I used BusyBox Installer by JRummy16 from the Market and installed the latest version in /system/xbin.
3. Install OpenVPN Installer and and OpenVPN Settings from the Market.
4. Run OpenVPN Installer and install into /system/xbin. When it asks you for the location of BusyBox, say /system/xbin/bb
5. Create symlinks of ipconfig and route inside /system/xbin/bb:
a) Enable USB debugging mode (Settings -> Applications -> Development) and connect your phone to your PC via USB. You will need the adb.exe commandline tool form KeksFlip's rooting guide.
b)
Code:
adb remount
adb shell
$ su
# mkdir /system/xbin/bb
# ln -s /system/xbin/ipconfig /system/xbin/bb/ipconfig
# ln -s /system/xbin/route /system/xbin/bb/route
6. Upload your OpenVPN configuration files and keys to your phone and put them in /sdcard/openvpn
7. You will need a TUN kernel driver module. I have attached the one I made for my kernel to this post. If your kernel version is 2.6.35.7-perf, you can use it otherwise you will need a different one. Put the tun.ko file in /sdcard/openvpn.
8. Run OpenVPN Settings and under Menu -> Advanced configure the following:
Code:
- Load tun kernel module ✓
- TUN module settings
- Load module using: insmod
- Path to tun module: /sdcard/openvpn/tun.ko
9. Start your VPN connection
Good luck!
dbx4 said:
Here's how I did it:
1. Root your phone using KeksFlip's excellent supereasy guide
2. Install Busybox. I used BusyBox Installer by JRummy16 from the Market and installed the latest version in /system/xbin.
3. Install OpenVPN Installer and and OpenVPN Settings from the Market.
.........
Good luck!
Click to expand...
Click to collapse
I have samsung Galaxy S Plus phone (firmware I9001XXKPF), I want to build a module tun.
tell me plz the link where to download the source code for kernel 2.6.35.7-perf (androind 2.3.5) to compile the module yourself.
Hi, I rooted my Galaxy S Plus using KeksFlip's guide. I then tried to install OpenVPN dbx4's method. However I got stuck at adb remount:
Code:
D:\temp\adb>adb remount
remount failed: Operation not permitted
D:\temp\adb>adb shell
$ su
su
# mkdir /system/xbin/bb
mkdir /system/xbin/bb
mkdir failed for /system/xbin/bb, Read-only file system
#
Is there anything I'm doing wrong?
Thanks!
You have to remount the system-filesystem on GT-i9001 yourself in adb shell:
mount -o rw,remount -t ext4 /dev/block/mmcblk0p15 /system
When you're done, mount read only again:
mount -o ro,remount -t ext4 /dev/block/mmcblk0p15 /system
Can anyone tell me why the module fails to insert even though it's the same kernel number?
"init_module tun.ko failed (exec format error).
I have the same problem with cifs.ko that is also built for my phone's kernel.
it is not tested on galaxy mini so I will say it beta, please its a request to post a reply whether it is working or not
bash:- an advanced command line than sh, it is colorful so you can differentiate the commands easily
steps for installing bash if you have cwm and want automated process
1:- download the bash command line flashable zip from here
2. download bash enabler script from here
3. flash the bash command line dhlalit11.zip in cwm recovery
4. boot the device normally
5. with the help of script manager execute the bash install.sh script with su privilege
and you are done
Click to expand...
Click to collapse
steps for installing bash if you don't have cwm or want to do it manually
1:- download the bash command line flashable zip from here
2. extract the files to a folder
3. go to /extracted folder/system
4. copy all the files to your system as they are placed
5. open terminal and type chmod 0755 /system/xbin/bash
and its done
Click to expand...
Click to collapse
note:- running bash will not give you root privilege automatically, you will need to type "su -c bash" to go directly into bash with root
reserved
if you don't mind...you can add this line into your updater script
Code:
set_perm(0, 0, 0755, "/system/blabla-the file position");
this one will automatically change the file permission for you so that we don't have to run the script anymore. you can also add symlink("/system/bin/bash", "/system/bin/sh"); to replace our old sh with bash so that everytime we use sh command, we will run bash instead. I was using these trick on my old ROM. however, this step will erase our sh binary file. so we must use it carefully. I usually did these step on a fresh rom installation. you might want to test it by yourself to make sure everything is alright.
I like to make scripts and one more reason is the script first looks for bash in /system/xbin to ensure a proper flash, if bash is not found it will tell the owner
didn't wanted to replace sh
if the purpose is to check whether it was installed correctly or not you can use run_program command instead and make the installation a lot simpler. you can put the script temporary in cache and delete it after the installation complete. or else...you can play with aroma installer. you can design the UI with several option like
1. install bash
2. symlink bash to sh
3. check the bash installation status
4. etc etc (as you like)
aroma could make our usual installation stuff into sumething more fun and interactive ^,^v
anyway, this is only a suggestion. if you want to use aroma you can modify my multi tweak installer. you said that you like to make scripts. it will be easy for you to get the basic stuff on aroma and starting to made one for your self. the link is in my sig. check the akuro or one pack tweak thread and got the aroma from the latest version there.
script run in cwm do not print anything on the UI and the user will not see whether the it was done or not
and I had previously used aroma in my rom patch for galaxy s series but this is just a simple task to do
I will think about it, but sure it will take time and I don't have time as I wanted to update the sticky of this forum then I am working on two mods for my karbonn smart tab 1
but I will for sure figure it out
installing bash
hi i have a Galaxy Centura tracphone and i get this error after executing su-c bash into the cmd via adb......I have installed the flashable zip and ran the installer script....
255|[email protected]:/system/bin # su -c bash
su -c bash
link_image[1936]: 7974 could not load needed library 'libncurses.so' for 'bash
(load_library[1091]: Library 'libncurses.so' not found)CANNOT LINK EXECUTABLE
255|[email protected]:/system/bin #
any ideas?
Bash
Hi, I managed to install the ZIP file (Moto G XT1032) and the script worked as well but after it was done, bash didn't have 755.
I tried adding it manually (as root) but it fails with this error:
Unable to chmod /system/xbin/bash: read-only filesystem
I tried remount using this:
su mount -o remount,rw /
But still no luck, any suggestions?
---------------------------------------------------- UPDATE -------------------------------------------------------
managed to get it via ADB Shell with this commands:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
chmod 755 /system/xbin/bash
still not working because of not having "libncurses.so" which will try to install manually.
ThePlayer10 said:
Hi, I managed to install the ZIP file (Moto G XT1032) and the script worked as well but after it was done, bash didn't have 755.
I tried adding it manually (as root) but it fails with this error:
Unable to chmod /system/xbin/bash: read-only filesystem
I tried remount using this:
su mount -o remount,rw /
But still no luck, any suggestions?
---------------------------------------------------- UPDATE -------------------------------------------------------
managed to get it via ADB Shell with this commands:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
chmod 755 /system/xbin/bash
still not working because of not having "libncurses.so" which will try to install manually.
Click to expand...
Click to collapse
You didn't needed to type whole dev block address, what you were missing was
(su
mount -o remount,re /system)
You were actually mountung the root of your device instead of system partition, which was the reason of non-working
I wanted to enable SCP and SSH using DropBear II ... for some reason DropBear Server II doesn't install scp & ssh binaries, you can get them from github and symlink it into system. Here's what I did...
DropBear archive (1M): https://www.dropbox.com/s/h2guipuvdltiden/dropbearii.zip
Feel free to mirror that if you want.
These directions allow you to ssh into the system as root, be very careful. I recommend not leaving the service running if you are not using it.
I take no responsibility if you brick your unit while mucking around as root.
Back Up
Download dropbearii.zip and unzip on your local file system.
From your local filesystem install the APK and push scp & ssh to tmp.
Code:
adb install DropBearServer2.1.apk
adb push scp /data/local/tmp/scp
adb push ssh /data/local/tmp/ssh
From the OUYA GUI install the DropBearServerII service... Select Make -> Software -> DropBearServer II -> Install
Shell into your OUYA and make /system writable.
Code:
adb shell
su
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
Move scp & ssh into DropBear II directory
Code:
mv /data/local/tmp/scp /data/data/me.shkschneider.dropbearserver2/app_data/
mv /data/local/tmp/ssh /data/data/me.shkschneider.dropbearserver2/app_data/
Change the permissions
Code:
chmod 6555 /data/data/me.shkschneider.dropbearserver2/app_data/scp
chmod 6555 /data/data/me.shkschneider.dropbearserver2/app_data/ssh
Create the symlinks
Code:
cd /system/bin/
ln -s /data/data/me.shkschneider.dropbearserver2/app_data/scp ./scp
ln -s /data/data/me.shkschneider.dropbearserver2/app_data/ssh ./ssh
Change /system back to read-only (optional) and exit.
Code:
mount -o ro,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
exit
exit
Reboot the OUYA (optional)
Code:
adb reboot
Notes/testing
Windows users can use Putty to ssh & scp get them here.
To ssh into the system:
Code:
ssh [email protected]_ADDRESS
To scp a file to the sdcard:
Code:
scp ./some_file [email protected]_ADDRESS:/sdcard/
To get to settings push the U circle button one time.
If you turn on "Start on boot" in the settings menu and reboot, the service will be turned off. Though it will be left on in the standard standby mode.
I recommend using pubkey rather than password. Basically generate a public key and push it into /sdcard/ then install it from the DropBear II app.
Unix Hosts can do:
Code:
ssh-keygen -t rsa
Windows using PuttySSH follow these directions, I haven't tested them though.
If you don't want to be bothered with pubkey, please change the default password it is set to 42.
If you already know about pubkey, you can cat them into: /data/data/me.shkschneider.dropbearserver2/app_data/authorized_keys
Unchecking "Allow Password" doesn't work properly.
Why would I want to do this? I didn't really like the Wireless ADB disappearing after the OTA upgrade, this may be less annoying if the next OTA doesn't nuke it.
I'm getting an error that busybox is not installed when trying to start the service. Is there anything special you had to do with busybox to get this to run? I installed it via the apk.
Edit: Nevermind. I didn't realize the busybox apk was an installer and I didn't find the icon when I looked. Just checked again and found the busybox installer icon and did a smart install. Dropbear ssh is running now.
I ran it manually with
Code:
dropbear -E -s -P /data/dropbear/dropbear.pid -r /data/dropbear/dropbear_rsa_host_key -d /data/dropbear/dropbear_dss_host_key
and it looks ok when idling but when connection it gives me
Aiee, segfault! You should probably report this as a bug to the developer
Click to expand...
Click to collapse
This could be CM10.1 environment issues (libc). The built-in SSHd doesn't work properly as well. Some binaries give strange errors when executed with SSHd (like sqlite3).
I can't install the DropBearServer II from the Make option, comes up with "operation failed". Tried to make the system rw to see if that might have been the problem but still no luck. Anyone else had that problem?
andlid said:
I can't install the DropBearServer II from the Make option, comes up with "operation failed". Tried to make the system rw to see if that might have been the problem but still no luck. Anyone else had that problem?
Click to expand...
Click to collapse
I installed it via adb.
For others I was able to install using IncognitoMan's -=StockPlus=- ROM -- http://forum.xda-developers.com/showthread.php?t=2347214
You may need busybox installed, I'm not 100% sure, I haven't tried without busybox.
SSH command line on android
The link is broken
Could someone please reupload this? would be awesome
Thank you so much
BIade said:
Could someone please reupload this? would be awesome
Thank you so much
Click to expand...
Click to collapse
bump - upload again please
You can also get static binaries from dropbear or ssh server apks in playstore by simply unpacking the apk.
I'm running MyROM 1.2 and it doesn't have tun.ko which I need. I tried the installer from google play without success. I'm willing to change ROMS if necessary but I need to know which ones have it already integrated or how to install it. If I have to compile it please give details instructions.
go0 said:
I'm running MyROM 1.2 and it doesn't have tun.ko which I need. I tried the installer from google play without success. I'm willing to change ROMS if necessary but I need to know which ones have it already integrated or how to install it. If I have to compile it please give details instructions.
Click to expand...
Click to collapse
Module must be compiled exactly for your kernel version.
You have to download kernel sources, compile kernel and module, so vermagic of kernel and module will be the same.
I can try to compile this module for you, but you need to provide me content of your /proc/version file for spoof kernel version for verification.
Kostyan_nsk said:
Module must be compiled exactly for your kernel version.
You have to download kernel sources, compile kernel and module, so vermagic of kernel and module will be the same.
I can try to compile this module for you, but you need to provide me content of your /proc/version file for spoof kernel version for verification.
Click to expand...
Click to collapse
Hi Kostyan,
I'm not certain I know where to get the sources from and the next steps to compile the module. Is there a tutorial somewhere?
My /proc/version reads:
Linux version 3.0.8-00370-g3be8d90 ([email protected]) (gcc version 4.7 (GCC) ) #1 SMP PEEMPT Tue Sep 2 13:21:11 CST 2014
Click to expand...
Click to collapse
Create directory for module:
Code:
adb shell
su
mount -o rw,remount /system
cd /system/lib
mkdir modules
exit
exit
Copy module in /system/lib/modules
Set permission 644 for tun.ko
Try to load module:
Code:
adb shell
su
insmod /system/lib/modules/tun.ko
if insmod will fail, get error description by this command:
Code:
dmesg | grep insmod
P.S. All these operations requires full root access.