LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Thread Tools Search this Thread
Old 03-13-2007, 04:19 AM   #1
just_a_kid
LQ Newbie
 
Registered: Dec 2006
Posts: 24
Thanked: 0
How do i know my currently logged on userid in Solaris/Unix


[Log in to get rid of this advertisement]
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.
just_a_kid is offline     Reply With Quote
Old 03-13-2007, 05:13 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,394
Thanked: 2
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".
timmeke is offline     Reply With Quote
Old 03-14-2007, 09:36 PM   #3
just_a_kid
LQ Newbie
 
Registered: Dec 2006
Posts: 24
Thanked: 0

Original Poster
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
just_a_kid is offline     Reply With Quote
Old 03-15-2007, 01:23 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris & OpenSolaris based distros, Ubuntu
Posts: 8,264
Thanked: 117
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
jlliagre is offline     Reply With Quote
Old 03-15-2007, 01:46 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :}
Posts: 19,146
Blog Entries: 1
Thanked: 201
Moved: This thread is more suitable in <Solaris> and has been moved accordingly to help your thread/question get the exposure it deserves.
Tinkster is online now     Reply With Quote

Reply


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


All times are GMT -5. The time now is 06:17 PM.

Main Menu
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.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration