Reply
Thread Tools
Posts: 2 | Thanked: 0 times | Joined on Aug 2010
#1
Hi, just started with my maemo, and once I gained root access by typing "sudo gainroot" I could ls into some root folders.

My question is how do I exit the root account, become user again, I tried to exit the terminal, and restart the phone, but no luck, each time the ls command is entered on the root folders it works.

I want to be user again.

Regards
Maemon
 
debernardis's Avatar
Posts: 2,142 | Thanked: 2,054 times | Joined on Dec 2006 @ Sicily
#2
Normally when you open the terminal you're user. Open a new terminal, issue the "whoami" command - it should give you "user".
__________________
Ernesto de Bernardis

 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#3
Originally Posted by maemon View Post
My question is how do I exit the root account, become user again
Type Ctrl-D or "exit"+enter.

each time the ls command is entered on the root folders it works.
That's probably because the permissions on the directory allow it - for example:

Code:
$ ls -ld /root/
drwxr-xr-x    5 root     root            0 Aug 27 02:24 /root/
The green permission bits indicate that everyone can see the contents of the directory (r) or cd into it (x) but not write (- instead of w).
 
Posts: 5,795 | Thanked: 3,151 times | Joined on Feb 2007 @ Agoura Hills Calif
#4
I'm not using sudo gainroot, but just root, a command that becomes available after rootsh is installed.

In that case, to become user again you just type exit and whoami shows you are user again. I just confirmed that.
__________________
All I want is 40 acres, a mule, and Xterm.
 
Posts: 86 | Thanked: 54 times | Joined on Mar 2010
#5
Being or not being root does not restrict access to the root mountpoint of the filesystem /. The default user account can see the root mount and even create files and directories (they will be created with permissions for the user account).

As stated above, the command to see what account you are using from the terminal is 'whoami'. If it comes back as 'root' and you want to get back to 'user', simply type 'exit'.
 
Posts: 2 | Thanked: 0 times | Joined on Aug 2010
#6
Ok, thanks all, whoami did state off course user after restarting the xterm.

The folder I did ls on stated "permission denied" before I did sudo gainroot, now it just list files under that folder even with the user account, thats why I thought the user where always root.

its a bit strange, isn't it?

regards
Maemon
 
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#7
Originally Posted by maemon View Post
each time the ls command is entered on the root folders it works.
Yeah, it is expected to work as user... (user has read permissions)

Anyways, you can exit from root terminal with the 'exit' command. 'whoami' tells you what user you are at the moment.
 
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#8
I use usually
Code:
su user
for some weird reason....
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search
 
fnordianslip's Avatar
Posts: 670 | Thanked: 359 times | Joined on May 2007
#9
Originally Posted by ossipena View Post
I use usually
Code:
su user
for some weird reason....
Then when you exit, you'll be root again. The shells are nested inside each other.
__________________
Class .. : Lame hacker & beardy boffin
Humour . : [#######---] Alignment: Apathetic anarchist
Patience : [####------] Weapon(s): My cat, my code.
Agro ... : |#---------] Relic(s) : N900, MacBookPro, NSLU2, N800, SheevaPlug, Eee-901, Core2-Quad, PS3
"In theory, theory and practice are the same. In practice, they're not."
--
Beware of extras-devel.
 
Posts: 1,425 | Thanked: 983 times | Joined on May 2010 @ Hong Kong
#10
Originally Posted by ossipena View Post
I use usually
Code:
su user
for some weird reason....
You should use the following command to switch to user instead:

Code:
su - user
 

The Following User Says Thank You to 9000 For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 07:59.