[SOLVED] clarification about root


Results 1 to 5 of 5

Thread: [SOLVED] clarification about root

  1. #1
    Join Date
    Mar 2006
    Posts
    17

    [SOLVED] clarification about root

    i've got slackware 10.2, and i boot from a floppy, didn't get my LILO installed right, anyway, my ? is:

    when i log in as root and get: root@darkstar:~$ , is this my '/root' directory, i.e., my 'root home' directory ?

    and if so is this the directory i DON'T want to be in when doing ordinary stuff ( so if i mess up i don't mess up massively) ? OR

    is this okay, and just plain ' / ' is where i don't want to be in order to keep from messing up badly ?

    also, if i log in as joe@darkstar:~# and then 'su', am i in '/ ' or /root ?

    obviously i'm new and need some clarification !

    and why do i get the '$' when i first login and then get the '# ' at the command prompt ?
    Last edited by fyodor120; 03-18-2006 at 01:21 PM. Reason: grammar

  2. #2
    Join Date
    Nov 2002
    Location
    Dayton, OH
    Posts
    986
    The # is usually used to denote when you are the root user and the $ is usually used to denote that you are an ordinary user.
    "After all you've seen, after all the evidence, why can't you believe?"

    IBM Thinkpad T21
    750 Mhz P3, 128 MB PC100 RAM, CD-ROM, 10 GB IDE HDD
    Ubuntu 9.04 Minimal

  3. #3
    Join Date
    Apr 2003
    Location
    UK
    Posts
    1,180
    Quote Originally Posted by fyodor120
    when i log in as root and get: root@darkstar:~$ , is this my '/root' directory, i.e., my 'root home' directory ?
    Yes.

    and if so is this the directory i DON'T want to be in when doing ordinary stuff ( so if i mess up i don't mess up massively) ? OR

    is this okay, and just plain ' / ' is where i don't want to be in order to keep from messing up badly ?
    You really just don't want to be root more than necessary because whatever directory you are in you still have the capability to destroy your system for example you could intend to type "rm -rf /pathto/randomdirectory" but accidentally add a space and type "rm -rf / pathto/randomdirectory" which would delete everything on your hard drive. In this situation it wouldn't matter which directory you were in. Of course being in / is more risky than being in /root.

    also, if i log in as joe@darkstar:~# and then 'su', am i in '/ ' or /root ?
    You would stay in /home/joe, if instead you used "su -" that would invoke a login shell (it is sometime necessary to do this so you have root's PATH which, on some systems, is different to that of a regular user) so you should then be in /root.

  4. #4
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    Quote Originally Posted by retsaw
    You would stay in /home/joe
    By default that's probably true. But it is possible to modify root's ~/.bashrc file so that you get changed into any directory; the answer to the original question is more accurately "it depends on your distro and any modifications you may have made to it".

    As for this question:

    Quote Originally Posted by fyodor120
    and if so is this the directory i DON'T want to be in when doing ordinary stuff
    It's not so much that you don't want to be in a specific directory. It's more that you don't want to be root, at all. You want to be a normal user, because normal users don't have permission to change anything except their own files and directories.

    If you're root, then no matter which directory you're currently in, there's a chance of screwing everything up. If you're not root, then that chance doesn't exist. (retsaw talked about this as well.)

  5. #5
    Join Date
    Apr 2003
    Location
    Buenos Aires, Argentina
    Posts
    4,219
    Guys, don't play with the root user, use it only for administration tasks
    djserz.com.ar
    "All the drugs in this world won't save you from yourself..."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •