[APP] DropBear Server II // ssh/scp (root only) - Ouya Android Development

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.

Related

OpenVPN on Galaxy S Plus I9001

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.

[GT-P3XXX] busybox + install-script [+cyanogen edition][2012-08-15]

Hi folks,
here's an easy-to-install busybox for your Galaxy Tab 2. NOW with Cyanogen Mod support.
ChangeLog:
BusyBox 1.21.0-git Nano1 (2012-07-28): initial release
BusyBox 1.21.0-git Nano2 (2012-07-29): applied various patches:
BUGFIX: flush all open files after listing them (ls)
BUGFIX: when setting hostname from file p**** whole name
COMPAT: ps now accepts (= ignores) all options a POSIX ps should
allow passing -mthumb to make
ash applet now exports HOME
silently ignore processes from inittab with terminal names without matching device file
default behaviour of 'showkey' applet changed from displaying interpreted keycode to decimals
do not show a message when testing an uninitialized variable
changed some terms in top applet output (rss vs. vsz)
BusyBox 1.21.0-git Nano3 (2012-08-05): major fix
NEW: rfkill applet¹
several minor modifications to applet
BUGFIX fixed a bug in busyinstall that left system without 'sh' upon uninstall²
provide busybox-patches to the world
BusyBox 1.21.0-git Nano4 (2012-08-15): minor fix / cm 10 edition
updated to latest git (some bugfixes)
BUGFIX: reading profile now works
BUGFIX: adjusted shell paths
BUGFIX: history now works
BUGFIX: no longer replace reboot on stock rom³
NEW: Cyanogen Mod edition (tested on cm10)
¹ Either redo 'busyinstall install', or do 'ln -sf /system/bin/busybox /system/bin/rfkill'
² You can find the original sh in you CWM backup, or here: http://www.nanolx.org/downloads/P3110/original-sh
If you didn't get /system/bin/sh.orig after 'busyinstall install', use this file as /system/bin/sh.orig
³ push new busyinstall into tablet to ensure future install/uninstall is fine. then do 'mv /system/bin/reboot.orig /system/bin/reboot'
from within 'adb shell' as root to get original reboot back.
Prerequisites:
* root access on your Tablet
Download:
busybox (normal): http://www.nanolx.org/downloads/P3110/busybox-nano4
busybox (debug): http://www.nanolx.org/downloads/P3110/busybox_unstripped-nano4
busyinstall (installer/stock): http://www.nanolx.org/downloads/P3110/busyinstall
busyinstall (installer/cm10): http://www.nanolx.org/downloads/P3110/busyinstall-cm
profile (optional): http://www.nanolx.org/downloads/P3110/profile¹
busybox (patches): http://www.nanolx.org/downloads/index.php?dir=P3110/busybox-patches/
¹ profile is a generic file, read on each startup of busybox. Mine sets HOME to /,
and puts /system/xbin/ in front of /system/bin/ in PATH. You can also adjust the
prompt (PS1) or whatever here, it's valid for all users. You could check for
'$(id -u) == 0' to adjust prompt for root, if not 0, for ordinary user.
Ordinary user should get 'busybox (normal)', rather than 'busybox (debug)'.
NEW INSTALLATION (STOCK ROM):
Putting busybox on internal sd-storage:
Code:
adb push busybox /mnt/extSdCard/
adb push busyinstall /mnt/extSdCard/
replace "extSdCard" if you saved busybox somewhere else
Code:
adb shell
su
chmod 0777 /mnt/extSdCard/busybox
chmod 0777 /mnt/extSdCard/busyinstall
/mnt/extSdCard/busybox remount -o rw,remount /system
/mnt/extSdCard/busybox mv -f /mnt/extSdCard/busybox /system/bin/
/system/bin/busybox mv -f /mnt/extSdCard/busyinstall /system/bin
busyinstall install
NEW INSTALLATION (CYANOGEN ROM):
Putting busybox on device:
in Settings > Development > set 'root access' to 'apps + adb'
Code:
adb root
adb shell
busybox mount -o rw,remount /system
exit
adb push busybox /system/xbin/busybox.nano
adb push busyinstall /system/bin/busyinstall
adb push profile /system/etc/profile # optional, if downloaded profile
adb shell
chmod 0777 /system/bin/busyinstall
busyinstall install
UPDATE:
Just download busybox, busyinstall and replace the ones in /system/bin/ - it will instantly work:
Code:
adb push busybox /system/bin/
adb push busyinstall /system/bin/
adb shell
su
toolbox chmod 0777 /system/bin/busybox # if you use windows, the executable bit might be missing in the uploaded file
chmod 0777 /system/bin/busyinstall
UNINSTALLATION:
Code:
ab shell
su
busyinstall --
That's it!
I tested everything and it does work perfect, either way a backup (CWM) is always recommened, when working around with stuff down the stack.
Suggestions welcome.
Out of curiosity, what is the difference between what this does and what BusyBox (by Stericson) from the Play Store does?
Sent from my MB855 using Tapatalk 2
Jleeblanch said:
Out of curiosity, what is the difference between what this does and what BusyBox (by Stericson) from the Play Store does?
Sent from my MB855 using Tapatalk 2
Click to expand...
Click to collapse
mine is a newer version
has all features of busybox (stericsons free version does not have all applets in busybox enabled, eg. 'sh' applet is missing)
installation 100% GT-P3XXX optimized
As of now, mostly personal preference I'd say.
Edit: But I'm currently applying stuff from busybox-power (maemo) which adds serveral bugfixes and stuff to busybox.
OK, improved version of busybox available in post 1 (+ changelog)
OK, thanks for letting me know!
I actually haven't done much with my Tablet lately as I've been busy with my phone as that now has CM10 too
But once I get my phone all set I'll use your BusyBox and give it a go!
Also, you said your busybox version is newer...but busybox via my phone is version 1.20.2. Just letting you know!
Thanks for this btw, I'd rather have a modified version optimized for my tablet versus a more universal version so to speak. Plus, with your updated applets! Thanks!
Sent from my MB855 using Tapatalk 2
Jleeblanch said:
Also, you said your busybox version is newer...but busybox via my phone is version 1.20.2. Just letting you know!
Sent from my MB855 using Tapatalk 2
Click to expand...
Click to collapse
Oh, ... mine is 1.21.0-git - fixed the typo
First,thank you for your work,second I've a question: I've an p3100 (wifi+gsm) ,it rooted on stock 4.0.4 ,and no busybox installed.It has 16gb onboard ,and I don't have at the moment any external microsd in slot,I've ordered an 32gb,but it hasn't come yet.Can you please tell me if it's safe puting your files in /sdcad (not ExtSdCard like you wrote) and give the commands using ''sdcard'' word ?
For e.g:
db shell
su
/mnt/sdcard/busybox remount -o rw,remount /system
I need busybox to backup my /efs folder ,but I don't want to screw something,so please tell me if it is safe to use internal memory (sdcard) for busybox install?Also ,when I'll receive the microsd ,I will need to install again busybox with your original commands from this topic ?
Thanks a lot!!
Best Regards!
viasat said:
First,thank you for your work,second I've a question: I've an p3100 (wifi+gsm) ,it rooted on stock 4.0.4 ,and no busybox installed.It has 16gb onboard ,and I don't have at the moment any external microsd in slot,I've ordered an 32gb,but it hasn't come yet.Can you please tell me if it's safe puting your files in /sdcad (not ExtSdCard like you wrote) and give the commands using ''sdcard'' word ?
For e.g:
db shell
su
/mnt/sdcard/busybox remount -o rw,remount /system
I need busybox to backup my /efs folder ,but I don't want to screw something,so please tell me if it is safe to use internal memory (sdcard) for busybox install?Also ,when I'll receive the microsd ,I will need to install again busybox with your original commands from this topic ?
Thanks a lot!!
Best Regards!
Click to expand...
Click to collapse
Of course you can. It does not matter where you put busybox. All that matters is, that you adjust the commands to your path.
In your you would push the files using ADB, like
Code:
adb push busybox /mnt/sdcard
adb push busyinstall /mnt/sdcard
also you don't need to re-do this when you got your sd-card, because during the steps you move busybox/busyinstall into /system/bin/.
Edit: updated instructions to clarify this.
Ok,thank you for your time,everything it's clear now.I'll try later,when I'm going home.
Cheers!
---------- Post added at 07:04 PM ---------- Previous post was at 06:11 PM ----------
OK,first problem:when I try to execute the first comand,it gives me ''permission denied'',so after a little reading,because my kernel it's stock,I've installed Chainfire's ''adbd Insecure v1.0 '' http://forum.xda-developers.com/showthread.php?t=1687590 to give me rights.After that I've no more errors,but,when I execute first command in adb,it says nothing,just hanging,and adb doesn't come back to # symbol ,and because of that I can't execute the next command.Any ideea what I'm doing wrong?Thanks!
What command failed?
Gesendet von meinem GT-P3110 mit Tapatalk 2
I don't know how to explain,it not really failed, but when I type
/mnt/sdcard/busybox remount -o rw,remount /system the adb doesn't return anything back,and doesn't come back to # symbol ,it just staying,nothing more,no response.I was waiting 2 minutes,and nothing ,doesn't return to # .I can type the next command
/mnt/sdcard/busybox mv /mnt/sdcard/busybox /mnt/sdcard/busyinstall /system/bin/
it's the same,no output,nothing.
Can you please tell me what I'm doing wrong?
Thanks again!
Now I'm stuck,even with adbd insecure activate I cannot execute commands:
C:\Documents and Settings\X\Desktop\ADB>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
[email protected]:/ # /mnt/sdcard/busybox remount -o rw,remount /system
/mnt/sdcard/busybox remount -o rw,remount /system
/system/bin/sh: /mnt/sdcard/busybox: cannot execute - Permission denied
126|[email protected]:/ # /mnt/sdcard/busybox mv /mnt/sdcard/busybox /mnt/sdcard/busy
install /system/bin/
dcard/busybox /mnt/sdcard/busyinstall /system/bin/ <
/system/bin/sh: /mnt/sdcard/busybox: cannot execute - Permission denied
126|[email protected]:/ #
Maybe I need first to install Stericsson's busybox from Market?At the moment,as I said before I don't have busybox installed at all,only su.
One more thing,every time when I save from your link busyinstall,no matter what browser,the file is saved as busyinstall.txt
It is normal ,or I need to rename it?
Thanks a lot!
Hmm... seems I forgot a little thing.
do this after you put busybox on tablet, before anything else:
Code:
adb shell
su
chmod 0777 /mnt/sdcard/busybox
then follow the rest of the instructions.
/goingtofixfirstpost
Same story,take a look:
[email protected]:/ # chmod 0777 /mnt/sdcard/busybox
chmod 0777 /mnt/sdcard/busybox
[email protected]:/ # chmod 0777 /mnt/sdcard/busyinstall
chmod 0777 /mnt/sdcard/busyinstall
[email protected]:/ # /mnt/sdcard/busybox remount -o rw,remount /system
/mnt/sdcard/busybox remount -o rw,remount /system
/system/bin/sh: /mnt/sdcard/busybox: cannot execute - Permission denied
126|[email protected]:/ #
Hmmm... > could you provide me the details of 'adb logcat'? Ensure to run those commands while logging.
Gesendet von meinem GT-P3110 mit Tapatalk 2
I don't know if this is what you want,but here we go:
I'm going to check your logs soon and report back.
Meanwhile I updated to Nano3 - see first post.
I got no clue why it does not work for you, but me.
What boot image and ROM are you using? Default boot/ROM, rooted boot/ROM, cyanogen?
I only tested default ROM with my boot. Currently testing cyanogenmod 10, but except some adjustments to busyinstall it will work there, too.
Sorry for the late reply,I'm on vacation until Sunday,and my acces to internet it's very limited here.Now,regarding my problem,first when I got the tablet it was on stock 4.0.3 ,wich I rooted manually to keep the counter to 0 (for warranity) ,and after that I updated to stock 4.0.4 using Mobile Odin Pro,with Everoot option ( it's rooting the rom on the fly) .So now I'm rooted on stock 4.0.4 ,stock recovery, and no busybox installed.I fell more secure and want to install your busybox version,because it's specialy designed for tab2,and it's has features from Maemo (I'm a big fan,I owned an N800,and I've also an N900 ).Maybe,if you have the time and the skills,you can pack it on an .apk version,if it's possible,of course.I will try more Sunday,when I'll be back home.Thanks again for your patience and help.Best Regards!
It will be great if we have a kernel (even stock) with CWM and this busybox...
I am also rooted with flash counter 0 and stock recovery.
Sent from my GT-P3110 using Tapatalk 2
Maybe some contributor creates a flashable zip (for CWM).
So... uploaded 1.20.1-Nano4. See first post for changes.
This time an addtional install-script for cyanogen mod was added, along some fixes.
ah... and: 100th post

[tutorial] install bash command line on your android

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

Rooting/unlocking Nexus One with broken power button using Linux terminal tools

I am attempting to get Cyanogenmod onto my Nexus One, but am running into far more problems than expected. The information on rooting Android devices seems heavily fragmented across the web and the tools unreliable. At least in my case, SuperOneClick has proven a complete misnomer. So I'd like to go back to basics - executing as many of the commands as possible from a Linux terminal to get the phone rooted/unlocked/whatever else has to happen to get Cyanogenmod installed. The two constraints I'm working with here are as follows:
1. The device is running Android 2.2.1 (I downgraded from 2.3.x using the PASSIMG method).
2. The power button on the device is broken, so any method which requires pressing/holding it is ruled out.
The problem I am having is that even after following Linux-centric guides, I get to the point of installing the SuperUser app followed by the ROM Manager app, but I'm never prompted to give ROM Manager superuser permissions and so can't flash the ClockworkMod recovery.
Below I describe the steps I've been taking so far, based on the "How To Root Nexus One Running Android 2.2.1 From Ubuntu Linux" guide (Google it, I can't post hyperlinks).
- Download/extract/move Nexus One Softroot files to same directory as adb
- From adb directory, execute the following commands:
sudo ./adb push psneuter /data/local/tmp/psneuter
sudo ./adb push busybox /data/local/tmp/busybox
sudo ./adb push su /data/local/tmp/su
sudo ./adb shell chmod 755 /data/local/tmp/psneuter
sudo ./adb shell chmod 755 /data/local/tmp/busybox
sudo ./adb shell chmod 755 /data/local/tmp/su
sudo ./adb shell cd /data/local/tmp ./psneuter
sudo ./adb shell
After executing sudo ./adb shell as above, I get the # prompt, which is purported to indicate that rooting was successful.
- Still following the guide, I then execute the commands which purportedly make root permanent:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /data/local/tmp
./busybox cp busybox /system/bin
chmod 4755 /system/bin/busybox
busybox cp su /system/bin
chmod 4755 /system/bin/su
exit
exit
- Again, still following the guide, I execute the commands which purportedly set the /system partition back to read-only:
sudo ./adb shell
su
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
exit
exit
- Now, I download the SuperUser app from the Android Market and open it to make sure it's running.
- Next, I download the ROM Manager app from Google Play (looks like it pulled a sneaky and upgraded from Android Market to Google Play here).
- I run ROM Manager and choose Flash ClockworkMod Recovery. I'm prompted to confirm the phone is a Google Nexus One and then ROM Manager runs for about 30 seconds (yellow program bar goes all the way) before spitting out An error occurred while attempting to run privileged commands!. And this is the point I am stuck at.
I should note that at no point am I prompted by the SuperUser app to give the ROM Manager app super user permissions. I don't restart the phone or do anything else throughout all of the steps I've described above, so I can't see any reason for root to have been lost at any point. In fact, if I execute the command sudo ./adb shell after all this, I still get the # prompt indicating root. And when I execute id afterwards, I get uid=0(root) gid=0(root) -- further confirmation of root. I really am stuck on this one. I've spent a lot of time digging through forum posts and online articles, but the signal to noise ratio is poor and I haven't been able to find anything that actually works. Can someone suggest where I am going wrong?
Programs might expect su to be in /system/xbin rather than /system/bin, which is probably your case.
Also, use SuperSU instead of Superuser.
Also, make sure the su you're using is matching the relevant control program - which means, downloading Superuser from the Play Store won't help, if it can't work with the binary you have. So download a complete ZIP from XDA with SuperSU.apk and su binary, and use those. The last version I used was 0.89 and it was on XDA just like I described above.
interesting problem with ez fix, get new phone. n1's are $100 on ebay, thats how i got mine.

[HOWTO] Installing Superuser/busybox for Mac

Device is pre-rooted, but only lets you do stuff via terminal. I didn't find a way to install Superuser/busybox on Mac, so I decided to make a simple guide. Took me all of 3min to complete, well since I already had the sdk and everything else installed.
You'll need this Superuser.apk, su binary and busybox.apk, dL the files from here http://d-h.st/BBk, once you have the files installed and launch Superuser it will ask you to update the binary, just click yes. Place the 3 files in your sdk/platform-tools folder.
Open Terminal cd sdk/platform-tools
On your Desktop go to Go…Go to Folder and type ~/.android, open adb_usb.ini and add 0x2836 to that file, save and close.
To verify it's listed:
./adb kill-server
echo 0x2836
./adb start-server
./adb devices
Your device should be listed here. If you want wireless adb access so you're not always hooked up to the console do the following, make sure your device is still connected via usb:
./adb tcpip 5555
unplug console
./adb connect xxx.xxx.xxx.xxx (this is the ip of your console, this is listed under manage…system…console info, should be the second line)
You're set, now you can install apps wirelessly to your OUYA console. You need to make the console read/write to do this do the following
./adb shell
su
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/UDA
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/CAC
Now we will install su binary, superuser and busybox
./adb push su/system/bin/su /sdcard/su
./adb shell
su
cat /sdcard/su > /system/xbin/su
ln -s /system/xbin/su /system/bin/su
chmod 6755 /system/xbin/su
exit
exit
./adb install com.koushikdutta.superuser.apk
./adb install stericson.busybox.apk
Should be up and running, if this helped you please thank me or donate a couple bucks
You rock!
I was at this for a while before I found your post. I'm on windows, but this is the only thread I could find that had anything useful Mind if I share this around on other forums?
Just link them back, steps are almost identical for Windows. Just need to remove the ./ from the adb commands
Sent from my HTC One using Tapatalk 4 Beta
WinDroidGuy said:
Device is pre-rooted, but only lets you do stuff via terminal. I didn't find a way to install Superuser/busybox on Mac, so I decided to make a simple guide. Took me all of 3min to complete, well since I already had the sdk and everything else installed.
You'll need this Superuser.apk, su binary and busybox.apk, dL the files from here http://d-h.st/BBk, once you have the files installed and launch Superuser it will ask you to update the binary, just click yes. Place the 3 files in your sdk/platform-tools folder.
Open Terminal cd sdk/platform-tools
On your Desktop go to Go…Go to Folder and type ~/.android, open adb_usb.ini and add 0x2836 to that file, save and close.
To verify it's listed:
./adb kill-server
echo 0x2836
./adb start-server
./adb devices
Your device should be listed here. If you want wireless adb access so you're not always hooked up to the console do the following, make sure your device is still connected via usb:
./adb tcpip 5555
unplug console
./adb connect xxx.xxx.xxx.xxx (this is the ip of your console, this is listed under manage…system…console info, should be the second line)
You're set, now you can install apps wirelessly to your OUYA console. You need to make the console read/write to do this do the following
./adb shell
su
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/UDA
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/CAC
Now we will install su binary, superuser and busybox
./adb push su/system/bin/su /sdcard/su
./adb shell
su
cat /sdcard/su > /system/bin/su
cat /sdcard/su > /system/xbin/su
exit
exit
./adb install com.koushikdutta.superuser.apk
./adb install stericson.busybox.apk
Should be up and running, if this helped you please thank me or donate a couple bucks
Click to expand...
Click to collapse
It's pure luck that this works. There's several things wrong with it.
There's no reason to have two copies of su. There should only be one, and at most have the other be a symlink.
the su binary should be chmodded '6755'.
It works because piping the contents of a file to another file usually leaves the permissions intact. So, sort of works - it leaves a broken copy of su in /system/bin and a luckily working one in /system/xbin.
So, tl;dr, the guide should be:
Code:
./adb push su/system/bin/su /sdcard/su
./adb shell
su
cat /sdcard/su > /system/xbin/su
ln -s /system/xbin/su /system/bin/su
chmod 6755 /system/xbin/su
exit
exit
./adb install com.koushikdutta.superuser.apk
rayman said:
It's pure luck that this works. There's several things wrong with it.
There's no reason to have two copies of su. There should only be one, and at most have the other be a symlink.
the su binary should be chmodded '6755'.
It works because piping the contents of a file to another file usually leaves the permissions intact. So, sort of works - it leaves a broken copy of su in /system/bin and a luckily working one in /system/xbin.
So, tl;dr, the guide should be:
Code:
./adb push su/system/bin/su /sdcard/su
./adb shell
su
cat /sdcard/su > /system/xbin/su
ln -s /system/xbin/su /system/bin/su
chmod 6755 /system/xbin/su
exit
exit
./adb install com.koushikdutta.superuser.apk
Click to expand...
Click to collapse
Thanks, this was my first time doing anything like this...figured I'd try to hack together something from other guides, since I didn't see very many people with the device yet. I will change it now
WinDroidGuy said:
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/UDA
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/CAC
Click to expand...
Click to collapse
This is really pointless, userdata is already RW, cache should be RW, but more importantly you do nothing that would require them to be remounted
I'm not sure what I am doing wrong here. Can anyone help? All the files are there.
TadeoNYC said:
I'm not sure what I am doing wrong here. Can anyone help? All the files are there.
Click to expand...
Click to collapse
The command should be "adb push su /sdcard/su" (pushing su to the sdcard).
Setup wired and/or wireless ADB
(Optional) Put adb.exe in your Windows PATH variable so you can run it from anywhere
Download and unzip the SuperUser files from http://d-h.st/BBk
Open an ADB shell with elevated permissions
Code:
adb shell
su
Mount the system partition as read-write
Code:
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
Exit the ADB shell
Code:
exit
exit
or CTRL + C
Push su to the sdcard
Code:
adb push su /sdcard/su
Open an ADB shell with elevated permissions
Code:
adb shell
su
Cat su into /system/xbin
Code:
cat /sdcard/su > /system/xbin/su
Create a symbolic link to su in /system/xbin from /system/bin (safer/cleaner than just putting su directly in the bin folder)
Code:
ln -s /system/xbin/su /system/bin/su
Set the su permissions to -rwsr-sr-x
Code:
chmod 6755 /system/xbin/su
Exit the ADB shell
Code:
exit
exit
or CTRL + C
Install SuperUser
Code:
adb install com.koushikdutta.superuser.apk
Install BusyBox
Code:
adb install stericson.busybox.apk
Run SuperUser on the OUYA (Make > Software > SuperUser) and allow it to update
Thank you Elmero.
I'm so glad I gave up and went to bed last night. It could not have gone smoother. I followed the instructions for setting up wireless adb from here http://forum.xda-developers.com/showthread.php?t=2272266 as well.
TIP: I wasted an hour or more trying to figure out why PC was not recognizing the OUYA at all. It was the stupid Micro usb port, compunding the fact that all the ports are to close to begin with the micro usb port is very deep. Neither of my Samsung cables worked, fortunately I have a kodak pocket video cam and the cable for that is a few mm longer and worked perfectly.
And who said Kodac isn't relevant anymore?
Sent from my Nexus 7 using xda premium
The link to the Superuser.apk is not working.
pdelponte said:
The link to the Superuser.apk is not working.
Click to expand...
Click to collapse
Working fine for me...
Sent from my HTC One using Tapatalk 4 Beta
WinDroidGuy said:
Working fine for me...
Sent from my HTC One using Tapatalk 4 Beta
Click to expand...
Click to collapse
Not working for me either.
This webpage is not available
The webpage at http://fs1.d-h.st/download/00044/BBk/superuser.zip might be temporarily down or it may have moved permanently to a new web address.
Click to expand...
Click to collapse
There is an issue with the website. Just try back until it connects.
Sent from my GT-P3113 using Tapatalk 2
just to be clear. once its rooted, can i install any android apk to the console? the one that i've bought from android play market?
tanush said:
just to be clear. once its rooted, can i install any android apk to the console? the one that i've bought from android play market?
Click to expand...
Click to collapse
1) It's already rooted.
2) You can already sideload anything you want to it, same as (almost) any android device, whether it is rooted or not. (http://forum.xda-developers.com/showpost.php?p=41796467&postcount=11)
elmerohueso said:
The command should be "adb push su /sdcard/su" (pushing su to the sdcard).
Setup wired and/or wireless ADB
(Optional) Put adb.exe in your Windows PATH variable so you can run it from anywhere
Download and unzip the SuperUser files from http://d-h.st/BBk
Open an ADB shell with elevated permissions
Code:
adb shell
su
Mount the system partition as read-write
Code:
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
Exit the ADB shell
Code:
exit
exit
or CTRL + C
Push su to the sdcard
Code:
adb push su /sdcard/su
Open an ADB shell with elevated permissions
Code:
adb shell
su
Cat su into /system/xbin
Code:
cat /sdcard/su > /system/xbin/su
Create a symbolic link to su in /system/xbin from /system/bin (safer/cleaner than just putting su directly in the bin folder)
Code:
ln -s /system/xbin/su /system/bin/su
Set the su permissions to -rwsr-sr-x
Code:
chmod 6755 /system/xbin/su
Exit the ADB shell
Code:
exit
exit
or CTRL + C
Install SuperUser
Code:
adb install com.koushikdutta.superuser.apk
Install BusyBox
Code:
adb install stericson.busybox.apk
Run SuperUser on the OUYA (Make > Software > SuperUser) and allow it to update
Click to expand...
Click to collapse
So what steps need to be repeated after the OTA?
from my limited understanding I think it should be steps 4 through 12. Or does the system partition not need to be mounted as read-write again?
Sent from my GT-P3113 using Tapatalk 4 Beta
Yup 4-12
Edit
If su is still on the sdcard you can skip 6-8... wont hurt if you do them though...
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
professorpoptart said:
Yup 4-12
Edit
If su is still on the sdcard you can skip 6-8... wont hurt if you do them though...
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
Click to expand...
Click to collapse
Might be a good idea to do them. The OTA version of such is different from the one in this guide. I had tried keeping the stock su and superuser complained
Sent from my Nexus 7 using xda premium
Do you still have access to the ouya store after SU installed? I heard rumors that access to the store was blocked until root access removed?
Sent from my GT-N7100 using Tapatalk 2

Categories

Resources