How do I see who I am logged in as ?

If I do “whoami” at the command prompt it will tell me either root or hexdump (my id).

This is what might be giving me misleading info. At least misleading to me, maybe not to you.

When I was trying to solve the “restart login” thing, this was how I was testing to see who I was logged in as.
I am thinking I have it all wrong and it’s all Linux’s fault.
These stoopid multi-user gotchas. >:)
I say this with all respect and kidding.
I just need to learn it.

hexdump@CorkyPC:~> 
hexdump@CorkyPC:~> whoami
hexdump
hexdump@CorkyPC:~> su -
Password: 
CorkyPC:~ # whoami
root
CorkyPC:~ # 

Does the “su -” change my login credentials ? Hmmm, I have to think about this.
Is it only for what I execute via the command line ?
If I were to spawn something with a GUI (Not sure I can do this) but would the permissions be passed along ?

My head hurts.:’(

Yep su changes who the system thinks you are. su - also give you the full root environment. Without the dash it keeps your user environment even though you become the user root.

In fact with su you can become any user on the system assuming you know the password. Note that the becoming is only applicable to the current process you are running and any child process started from that process. For example if you are logged in to a GUI as user1 and open a konsole and become root vi su/sudo/etc then open a second konsole and type whoami it will still say user1 but in the first knosole that is now root it will say root

When you start a process the environment and ownership is inherited from the parent process unless explicitly changed.

First lesson in OOP concepts- inheritance lol

Of course su changes your userid (and all that goes with it), that is what it is made for. :wink:

Please do

man su

like you do to consult the man page of every basic tool where you want to know more about it.

(BTW you can also type

#su

in the address bar of Konqueror for a nice HTML formatted version of the man page).

That “man” is new to me and quite useful. Thank you hcvv

You can use man with most any command and gets that commands manual pages

On Sat September 14 2013 02:56 pm, gogalthorp wrote:

>
> You can use man with most any command and gets that commands manual
> pages
>
>
In addition to “man” there is also the “info” command. e.g.


info su
info ls

For some commands info returns the same information as man; but often there
are examples and more about the semantics. Where man is focused on the syntax
info is focused on semantics.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On 2013-09-15 00:40, PV wrote:

> In addition to “man” there is also the “info” command. e.g.
>


> info su
> info ls
> 

There is also “pinfo”. It shows the info page if it exists, if not, it
tries the man page. The interface is a bit more intuitive than “info”.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

That’s really slick venzkep, thanks.