maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   [CLI] how to become root (https://talk.maemo.org/showthread.php?t=33911)

brankomilosevic 2009-11-03 14:44

[CLI] how to become root
 
Hello,

Can anyone explain how to become a root on my n900?

I did try:

edit /etc/gainroot - no permission.
ssh root@localhost - no ssh
sudo su - - password required (I do not have password)
passwd user - user password can not be changed
...

Marshall Banana 2009-11-03 14:47

Re: n900 how to become a root
 
Hi,

i think you have to install this first:
Rootsh

and/or do: sudo gainroot

MrGrim 2009-11-03 14:54

Re: n900 how to become a root
 
Isn't rootsh pre-installed? Or are we talking about the emulator?

sjgadsby 2009-11-03 14:56

Re: n900 how to become a root
 
Quote:

Originally Posted by MrGrim (Post 364540)
Isn't rootsh pre-installed?

No. X Terminal comes installed. rootsh requires a simple installation via the Application manager.

mikemorrison 2009-11-03 23:21

Re: n900 how to become a root
 
enable RD mode by using the flasher available here:

http://maemo.org/news/announcements/...ablo_released/

then to become root you can type:

Code:

sudo gainroot

GeneralAntilles 2009-11-03 23:53

Re: n900 how to become a root
 
Quote:

Originally Posted by mikemorrison (Post 364898)
enable RD mode by using the flasher available here:

No. You want rootsh.

R&D mode has additional performance and stability consequences that most users do not want. Please don't recommend it. :)

Bruce 2009-11-03 23:54

Re: n900 how to become a root
 
If you "sudo su" on a normal Unix box the password expected is your user accounts password.

Normally your account must be listed in /etc/sudoers

You also should be able to run programs as root by placing sudo before the name of the program.

qole 2009-11-04 00:09

Re: n900 how to become a root
 
If you install the openssh packages from the repositories, you can use the ssh root@localhost technique as well...

Netweaver 2009-11-04 01:06

Re: n900 how to become a root
 
I installed the 'rootsh' package but when executing the 'sudo gainroot' command in the xterm, in the 'device' screen, I'm getting :
Code:

'sudo: must be setuid root'
when I do in Scratchbox a 'ls -l /usr/bin/sudo' I'm getting this:

Code:

-rwsr-xr-x 2 maemo maemo 84212 2009-04-17 /usr/bin/sudo
shouldn't this be owned by root/root in a normal Linux install ? But this is under Scratchbox, already an emulated install...

anyway, I removed rootsh and reinstalled : same issue.
BTW, the package I'm installing has version 1.5.

the syntax 'rootsh <any single command>' seems to work, the rootsh shell script is created in the /usr/sbin directory but actually it doesn't have root powers either.

Is this supposed to work at all in the SDK ?
Thanks.

mikkov 2009-11-04 01:28

Re: n900 how to become a root
 
use fakeroot in scratchbox

qobi 2009-11-04 01:59

Re: n900 how to become a root
 
Quote:

Originally Posted by GeneralAntilles (Post 364924)
No. You want rootsh.

R&D mode has additional performance and stability consequences that most users do not want. Please don't recommend it. :)

Just curious: what are those "additional performance and stability consequences", i.e. what are all the things that R&D mode changes?

GeneralAntilles 2009-11-04 02:14

Re: n900 how to become a root
 
Quote:

Originally Posted by qobi (Post 365003)
Just curious: what are those "additional performance and stability consequences", i.e. what are all the things that R&D mode changes?

It enables the serial console (which consumes power), it changes some of the powersaving behaviors and, on the N900, it flashes the keyboard light when it's at 100% CPU, among other things.

Unless you have a specific reason for enabling it (root access doesn't count), don't.

qole 2009-11-04 02:30

Re: n900 how to become a root
 
You can tell by that detailed report that GeneralAntilles had to try it himself, just to see what happened :D ;)

GeneralAntilles 2009-11-04 03:20

Re: n900 how to become a root
 
Quote:

Originally Posted by qole (Post 365024)
You can tell by that detailed report that GeneralAntilles had to try it himself, just to see what happened :D ;)

Nah, I just listened to qwerty12 ***** about it for weeks on end. ;)

qgil 2009-11-04 03:39

Re: n900 how to become a root
 
http://wiki.maemo.org/Root_access

brankomilosevic 2009-11-05 12:52

Re: n900 how to become a root
 
Quote:

Originally Posted by qgil (Post 365046)

Thank you qgil. However, when I try sudo <anything> I am prompted for password. I have no password - not for 'user' nor for 'root'. Is there any default 'user' or 'root' password?

ossipena 2009-11-05 12:58

Re: n900 how to become a root
 
Quote:

Originally Posted by brankomilosevic (Post 366228)
Thank you qgil. However, when I try sudo <anything> I am prompted for password. I have no password - not for 'user' nor for 'root'. Is there any default 'user' or 'root' password?

just follow the wiki pages instructions, please. (and read the disclaimer on top)

e: doesn't passwd work?

eiffel 2009-11-05 13:24

Re: n900 how to become a root
 
Quote:

Originally Posted by brankomilosevic (Post 366228)
when I try sudo <anything> I am prompted for password

Don't run sudo <anything>, run specifically this: sudo gainroot

Then just use the root shell to run <anything>.

Regards,
Roger

brankomilosevic 2009-11-05 14:11

Re: n900 how to become a root
 
I got it. Thank you all. Sorry for disturbing you.

sjgadsby 2009-11-05 14:48

Re: n900 how to become a root
 
Quote:

Originally Posted by brankomilosevic (Post 366280)
I got it.

Keen!

Quote:

Sorry for disturbing you.
No need to apologize, most of the people who responded to this thread were disturbed well before you arrived. Please continue to ask questions when you need assistance.

buxz777 2010-02-01 22:12

Re: n900 how to become a root
 
can anyone just clarify what the root password on the n900 is

sometimes the command sudo gainroot will enable the shell othertimes it asks me for a password which i have never set

from reading the forums and wiki entrys i sort of found it could be either

rootme
passwd

is any of them correct it would be really handy to know as sometimes it wont let me enable shell unless i enter a password

thanks and sorry to bump an old thread like this just thought it better then startinga new one

Remyros 2010-03-18 22:42

Re: n900 how to become a root
 
I would need it too. I would appreciate a lot if someone could answer :) Thank you

nokian-series 2010-04-18 22:54

Re: n900 how to become a root
 
I've just re-flashed my N900.
I've seen the wiki: http://wiki.maemo.org/Root_access
I've already instaled roothsh.

My problem is:
Before reflash, i easly can do:
sudo echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

now, it says access denyed.

If i do: sudo /usr/sbin/kernel-load
It prompt for password :S help please

shadowjk 2010-04-18 23:07

Re: n900 how to become a root
 
try sudo gainroot

nokian-series 2010-04-19 06:39

Re: n900 how to become a root
 
sudo gainroot works, thats not the problem.
If anyone try : sudo echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
you'll sucessefull do it ! i cant do it ..
What is wrong with this device ..i've only reflashed it..my god : C

ceefour 2010-05-27 07:36

Re: n900 how to become a root
 
Quote:

Originally Posted by nokian-series (Post 616810)
Before reflash, i easly can do:
sudo echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

I don't think you could do that even before reflash.

Your command will run echo as root, but then pipe to a privileged file *without* root privileges.

For example, the following code rightly fails on my Ubuntu system (and on any Linux system):

Code:

$ sudo echo a > /hello
bash: /hello: Permission denied

What you should do is like this:

Code:

echo 900000 | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
(but you have to get sudo working correctly first)

jjpm 2010-08-15 02:14

Re: n900 how to become a root
 
When I run su - to login as root, it gives me the error "su: must be suid to work properly." I then changed permissions for busybox: chmod 4755 /bin/busybox. Now I am able to run the su command. My question is, for the n900/maemo platform, what will changing the permissions to busybox (as I did) affect or impact?

nokiaboy97 2010-08-30 05:52

Re: n900 how to become a root
 
this is going to sound like the most ignorant quesion ever but I have to ask. What are the advantages on becoming "root" on the N900? I'm obviously a noob and would understand if my account is banned because of this post lol

AlMehdi 2010-08-30 05:59

Re: n900 how to become a root
 
Quote:

Originally Posted by nokiaboy97 (Post 801996)
this is going to sound like the most ignorant quesion ever but I have to ask. What are the advantages on becoming "root" on the N900? I'm obviously a noob and would understand if my account is banned because of this post lol

Without "root" privileges you can't edit or change files outside your "/home" folder. For a normal user that is no problem.. but if you want to do the cool stuff then you need root. The n900 is really not the same without rootsh.

AlMehdi 2010-08-30 06:01

Re: n900 how to become a root
 
Quote:

Originally Posted by nokian-series (Post 617176)
sudo gainroot works, thats not the problem.
If anyone try : sudo echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
you'll sucessefull do it ! i cant do it ..
What is wrong with this device ..i've only reflashed it..my god : C

It's nothing wrong with the device.. it acts as it should. You need to edit your sudoers file to allow sudo with NOPASSWD. If you do not then sudo will give you a password.

Serach and you will find how to do it.

nokiaboy97 2010-08-30 06:37

Re: n900 how to become a root
 
Quote:

Originally Posted by AlMehdi (Post 802005)
Without "root" privileges you can't edit or change files outside your "/home" folder. For a normal user that is no problem.. but if you want to do the cool stuff then you need root. The n900 is really not the same without rootsh.

I suppose I would fall into the category of a "normal" user then. Linux seems confusing and not very user friendly but it does intrigue me and seems very efficient and manageable. What are some of these "cool things" that you can do with root?

frostbyte 2010-08-30 07:00

Re: n900 how to become a root
 
Overclocking. NITDroid. Secure Shell. Easy Debian... the list is pretty long, you have a couple of days to listen?

AlMehdi 2010-08-30 07:14

Re: n900 how to become a root
 
Quote:

Originally Posted by nokiaboy97 (Post 802028)
I suppose I would fall into the category of a "normal" user then. Linux seems confusing and not very user friendly but it does intrigue me and seems very efficient and manageable. What are some of these "cool things" that you can do with root?

It's little like beeing an administrator on the Windows system. It gives you privilegies to anything on the system. It is a big security treath to become administrator but still most windows user put them selves as this. On the linux system you normaly start as a normal user and become a super user (root) only when necessary.

For a normal user of the maemo system the root is not necessary. You can install and play with the normal things anyway. But if you would like to become a power user you need it. Like editing config-files, overclocking e.t.c... and it is here the real power of the n900 lays. The abillity to tweak the hell of it.

I have been using linux for quite some time now but did use windows before. And i would say that the linux way is more logical though it can be confusing in the beginning.

nokiaboy97 2010-08-30 07:21

Re: n900 how to become a root
 
lol I just want to "unleash" my N900

AlMehdi 2010-08-30 07:48

Re: n900 how to become a root
 
Quote:

Originally Posted by nokiaboy97 (Post 802047)
lol I just want to "unleash" my N900

Try to read up on root and the linux filesystem.. the more you understand about it the better. If you don't there is a big chance you mess up the system. And make backups.. trial by error is in my mind the best way of learning.

chemist 2010-08-30 08:10

Re: n900 how to become a root
 
Before this thread gets to long and more and more people contribute or ask questions I like to end this up with a summary.

To become root on your n900's Maemo5 you need to install rootsh, then you may become root by typing
Code:

root
or
Code:

sudo gainroot
in a terminal window (xterminal - open via menu or by pressing ctrl-shift-x).

If your "sudo <command>" does not work with permission denied you are probably trying to do two things at once where the first command is with root permissions but the 2nd isn't.

Please be sure to know your way around at the CLI before you proceed or follow step-by-step instructions carefully!

DO NOT ACTIVATE R&D MODE IF ONLY FOR ROOT PRIVILEGES


All times are GMT. The time now is 05:14.

vBulletin® Version 3.8.8