Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-13-2007, 03:19 AM
|
#1
|
|
LQ Newbie
Registered: Dec 2006
Posts: 24
Rep:
|
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.
|
|
|
|
03-13-2007, 04:13 AM
|
#2
|
|
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515
Rep:
|
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".
|
|
|
|
03-14-2007, 08:36 PM
|
#3
|
|
LQ Newbie
Registered: Dec 2006
Posts: 24
Original Poster
Rep:
|
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
|
|
|
|
03-15-2007, 12:23 AM
|
#4
|
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OL
Posts: 9,311
|
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
|
|
|
|
03-15-2007, 12:46 AM
|
#5
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,902
|
Moved: This thread is more suitable in <Solaris> and has been moved accordingly to help your thread/question get the exposure it deserves.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:59 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|