Editing Root access

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
{{danger}}
+
{{Midgard article}}
-
Having [[:wikipedia:Superuser|root]] access is an important step for users interested in modifying things "under the covers" of their tablets; without it, you won't have the necessary permissions to make those modifications. Root access is disabled by default on new tablets. Thankfully, the steps to enable root access are simple.
 
-
== Why do I want root? ==
+
OK, first, the disclaimer: '''Doing whatever is stated on this page is not endorsed by Nokia in any way.'''
-
Root access is ''not'' required to install additional applications through Application Manager, open X Terminal or use your tablet in day-to-day operation.
+
''Warning: There have been reports of display failures (white with dim vertical stripes) after disabling rd mode and rebooting a new 770. If you get this, there is a hardware failure in your device and you need to return it and get a replacement.''
-
If you want to edit the underlying system configuration, install applications ''through the command line'' or other low-level tasks, you ''will'' require root access.
+
Screenshot added: [http://www.circuitwizard.de/misc/2935.jpg Cracked screen]<nowiki>; </nowiki>[http://maemo.org/pipermail/maemo-users/2006-July/001605.html Screen bug Post].
-
== rootsh ==
+
== easyroot ==
-
<small>''Note: As rootsh is the simplest option, and does not require a desktop computer or running additional services, it is the recommended method for gaining root access.''</small>
+
-
<code>rootsh</code> is available in [[Extras]], and can be installed from the Application manager if you have the Extras repository enabled. It is also available directly from [http://maemo.org/downloads/product/Maemo5/rootsh/ maemo.org].
+
Install [http://nitapps.com/dists/chinook/user/binary-armel/easyroot_1.0-4_armel.deb easyroot] from [http://nitapps.com/ nitapps.com].
-
Then, from the [[terminal|shell]], run:
+
Then, from the shell, run <code>root</code>. This will give you a root shell.
-
sudo gainroot
+
-
(or <code>root</code> for short). This will give you a root shell.
+
-
== sudser ==
+
== OpenSSH ==
-
<small>''Note: Some scripts require rootsh to run properly, so it's recommended to have both sudser and rootsh installed if you're using sudser.''</small>
+
-
sudser adds the user to sudoers so you can use the <code>sudo</code> command to run commands as root.  
+
# Enabled Extras (if you haven't already).
 +
# Install OpenSSH (client and server).
 +
# SSH into your tablet as root
 +
## For local access, run <code>ssh root@localhost</code>
 +
## For remote access, run <code>ssh root@''tablet's ip address''</code>
 +
# Use the root password that the OpenSSH package asked you to enter to log in (in ancient OS versions you had to use the factory default "rootme" password).
-
It is available in Extras, and can be installed from the Application manager if you have Extras enabled.
+
== R&amp;D Mode ==
 +
<small>''Note: As R&D mode has other side effects beyond simply enabling root access (including several that can negatively impact battery life), it is ''not'' the recommended method for gaining root access. Use [[#easyroot|easyroot]] instead.</small>
-
Then, from the shell, run <code>sudo ''command''</code>. This will execute <code>''command''</code> with root privileges.
+
You can enable the Research &amp; Development mode (R&amp;D or RD mode, which enables you to execute <code>sudo gainroot</code> to get a root shell, simply follow the setup steps for flashing covered in [[Upgrading_tablet_OS#Flashing_your_Nokia_tablet|Upgrading tablet OS]], then execute
-
<small>''Note: Adding user to the sudoers without a password isn't best for security so use at own risk.''</small>
+
sudo ./flasher-3.0 --enable-rd-mode -r
-
== OpenSSH ==
+
You are now in R&D mode, and the sudo gainroot script's check will be satisfied.
-
# Enable Extras (if it is disabled)
+
== Securing root access ==
-
# Install OpenSSH (client and server)
+
-
#* This will prompt you to change the root password from the default, <code>rootme</code>
+
-
# SSH into your tablet as root
+
-
#* For local access, run <code>ssh root@localhost</code>
+
-
#* For remote access, run <code>ssh root@''tablet's ip address''</code>
+
-
# Use the root password entered at step (2) to log in
+
-
To debug issues with SSH connections, use the SSH '-v' option.
+
At this point you should have gained root access to your device, and be looking at the root prompt:
-
(To get SSH X forwarding ('-X' option) to work, you need to install ''xauth'' (or ''xbase-clients'') package and enable X forwarding in the SSH server configuration file on the machine where you're connecting to.)
+
<nowiki>#</nowiki>
-
== Research &amp; Development Mode (R&amp;D or RD Mode) ==
+
'''However, if your wi-fi network is not password protected, so might anyone else near you who has WiFi, SSH and a clue.'''
-
{{ambox|text=As R&D mode has other side effects beyond simply enabling root access (including several that may negatively impact battery life), it is ''not'' the recommended method for gaining root access. Use [[#rootsh|rootsh]] instead.}}
+
You still need to secure root-level access.
-
{{main|R&D mode}}
+
You also still need to secure the root account ("rootme" is a terrible password, and direct root log-in access is not necessarily required).
-
You can enable the R&D mode which enables you to execute <code>sudo gainroot</code> to get a root shell, simply follow the setup steps for flashing covered in [[Updating the firmware|updating the tablet firmware]], then execute
+
=== Set user password ===
-
sudo ./flasher-3.5 --enable-rd-mode -R
+
Set the [http://en.wikipedia.org/wiki/Password_strength password] for 'user':
-
You are now in R&D mode, and the sudo gainroot script's check will be satisfied.
+
passwd user
 +
 
 +
Note: when typing a password nothing will be shown on the screen.
 +
 
 +
Now, for the future, unless you want to keep SSH-ing from another machine, a clever move is to add "user" to sudoers:
 +
 
 +
echo "user ALL = PASSWD: /bin/su" &gt;&gt; /etc/sudoers
 +
 
 +
this way your password will be asked in order to become root. Or
 +
 +
echo "user ALL = NOPASSWD: /bin/su" &gt;&gt; /etc/sudoers
 +
 
 +
in order to become root without having to type your password.
 +
 
 +
Please keep in mind that password will be cached, so you won't have to type it ''every'' time you need to sudo.
 +
 
 +
Note that if you require a password to become sudo, some built-in apps (notably Application Manager) will appear to not load while they wait silently in the background for the password to be entered. The can be avoided by running a command in the xterm with sudo prior to lauching the app, so as to appease sudo when the OS calls it.
 +
 
 +
Ok, from now on all you have to do, in your Xterm session, to get root is to write:
-
== On-Device Sudoers Edit (No External Dependencies) ==
+
sudo su -
-
This covers how to get root access on-device. without any external downloads/dependencies, as well as advocates a more desktop-like approach to setting up your sudoers file.
+
-
http://talk.maemo.org/showthread.php?t=94494
+
-
== A note on sudo ==
+
=== Change root password ===
-
This information is aimed at people who come to maemo from other linux distributions (Debian for example) that may have used sudo in a different way.
+
<small>''Note: The OpenSSH requires that the root password be set as part of its installation process, if you have installed OpenSSH you have already completed this step''</small>
-
In fremantle (Maemo 5) sudo is a key part of the system. It is used by system processes that are started as the user to provide access (as root) when needed.
+
'''You ''MUST'' change (or disable) your root password before continuing!'''
-
Examples of this are:
+
Else you will be walking around with a device that can be accessed using a TRIVIAL and well known password.
-
Media Tracker.
+
-
The firmware version on the 'Settings' > 'About Product' page.
+
-
Both of these will malfunction if there are problems with sudo.
+
To change root password (as root user):
-
Sudo relies on <code>/etc/sudoers</code>, a configuration file that details who can run what commands. <code>/etc/sudoers</code> is traditionally modified by using the 'visudo' command. DO NOT DO THIS ON MAEMO. In maemo sudoers is regenerated periodically from config snippets in <code>/etc/sudoers.d/</code>, using <code>visudo</code> can cause the slow death of your system as your edit gets pushed further down /etc/sudoers.
+
passwd
-
For those who don't know, <code>/etc/sudoers</code> works on a last match principle, so if your edit conflicts with entries above it, it will break those entries.
+
When asked, input (twice) your [http://en.wikipedia.org/wiki/Password_strength new password].
-
The 'correct' way to do this would be to put your entry in a file in <code>/etc/sudoers.d/</code>. I leave the detail of this up the experience of the end-user. Just be advised that using <code>visudo</code> runs the risk of subtly breaking your system.
 
 +
[[Category:Users]]
 +
[[Category:Midgard wiki]]
[[Category:Wiki page of the day]]
[[Category:Wiki page of the day]]
-
[[Category:Power users]]
 

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: