LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-13-2007, 03:19 AM   #1
just_a_kid
LQ Newbie
 
Registered: Dec 2006
Posts: 24

Rep: Reputation: 15
How do i know my currently logged on userid in Solaris/Unix


Hi

Lets say i telnet using putty to my server
i logged in as normal ( lets say "guest" )

then i type "who am i"
This one works nice i know guest is logged on

but there is a problem
after i logged on as guest
i do "su - oracle" for example and provide correct password

how do i know that my "guest" userid already changed to "oracle"
i type who am i still "guest" is showing up.

Thanks.
 
Old 03-13-2007, 04:13 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Try "whoami" rather than "who am i".

The first displays the effective user, the latter is an invocation of "who" (that displays logged on users, etc - see man who) and is equivalent to "who -m".
 
Old 03-14-2007, 08:36 PM   #3
just_a_kid
LQ Newbie
 
Registered: Dec 2006
Posts: 24

Original Poster
Rep: Reputation: 15
apparently it is not working

i am using solaris

who - m will still give me username i logged on first time using putty
there is no whoami command in Solaris


any idea?
thanks
 
Old 03-15-2007, 12:23 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by just_a_kid
there is no whoami command in Solaris
Actually this BSD command is supported by Solaris:
/usr/ucb/whoami
and so is its System V equivalent:
/usr/bin/id
 
Old 03-15-2007, 12:46 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <Solaris> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


Reply



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
Why is Solaris so un-popular UNIX OS?? as400 Solaris / OpenSolaris 41 08-20-2006 10:07 PM
Extra Software for Solaris/Unix and Help Thorrn4 Solaris / OpenSolaris 7 03-18-2005 07:07 PM
NIS - Solaris and Unix integrated - problem andrec_ufmg Solaris / OpenSolaris 2 04-01-2003 11:03 AM
unix application on solaris/intel? chi Solaris / OpenSolaris 3 01-16-2003 11:15 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 11:28 PM.

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