Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 04-24-2005, 02:41 PM   #1
Registered: Sep 2004
Distribution: SUSE Linux Pro 9.3
Posts: 375

Rep: Reputation: 30
Am I running as ROOT?

Check this out:

jslay01@linux:~> whoami
jslay01@linux:~> id
uid=1000(jslay01) gid=100(users) groups=16(dialout),33(video),100(users)
Im logging in as: jslay01

During the installation process I included a ROOT password and a Username password FOR jslayton.

Last edited by wardialer; 04-24-2005 at 02:45 PM.
Old 04-24-2005, 03:09 PM   #2
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
If you were logging in as root, your user name would be root and when you open a console you'd see a # instead of a $.

From the above, you appear to be a normal user.
Old 04-24-2005, 03:16 PM   #3
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
jslay01@linux:~> whoami
Well, not sure why you think your root when it tells you who you are at the bash prompt and when running the whoami command.. you'd think if you thought you were running as root, you'd see root mentioned somewhere..
Old 04-25-2005, 01:31 PM   #4
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Edit your /etc/bashrc and put this in place of the PS1 line which is there now.

# bash-specific settings
if [ "$UID" -eq "$ROOT_UID" ]
PS1="\[\033[31;1m\]\u \d] \\$\w\n \[\033[0m\]"
PS1="\[\033[34;1m\]\u \d] \\$\w\n \[\033[0m\]"

This changes the shell prompt in the following ways:
If you are root, the name root shows, and the color is red (warning).
If you are user, the username shows, and the color is blue (cool).
The prompt also shows the day of the week, the month, the date, and the full path to wherever you are in the directory tree.

Never wonder again "am I root?".


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
running rsync as root msound Linux - Security 4 11-09-2005 10:16 AM
How could I tell if Im running as ROOT? wardialer Linux - Security 9 03-19-2005 09:47 PM
running programs from root oscarp Linux - Software 2 09-17-2004 08:08 AM
running as root murray_linux Slackware 4 11-11-2003 07:30 PM
installed as root, running as non-root? daniela Linux - Newbie 4 09-09-2003 04:41 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration