- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Could anyone explain it for me ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2002 07:11 PM
04-28-2002 07:11 PM
Could anyone explain it for me ?
I login as root and issued the following command:
# su - oracle
$ id
uid=101(oracle) gid=101(dba)
$ who am i
root pts/ta Apr 30 00:01
$ whoami
oracle
$ write oracle
oracle is not logged on.
Could anyone explain the above situation I have encounted?
Thanks!
Best Regards.,
May
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2002 07:40 PM
04-28-2002 07:40 PM
Re: Could anyone explain it for me ?
The tty is assigned to the login user. When you su, the tty you use still belong to user who login (i.e. root) not the user you su'ed to (i.e. oracle).
This will work:
# su - oracle
$ write root
This will write to pts/ta which is the tty of the login user or root. The message will be shown on your screen even after you su from root to oracle because oracle is using root's tty.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2002 07:48 PM
04-28-2002 07:48 PM
Re: Could anyone explain it for me ?
mars# who -uR
root ttyp1 Arp28 ... jupiter
Now I switched user to "skchan"
mars# su - skchan
mars# who am i
root
mars# whoami
root
mars# write skchan
skchanis not logged on
This is perfectly normal. The write command only write to the first tty session, in this case it's root, so if you write to "skchan it's not going to work since "skchan" did not directly logged in to mars. Example ..
mars# ps -ef|grep skchan
skchan ttyp1 .. -ksh
Noticed the tty session of "skchan" is the same as that of "root" in the "who -uR" command above ? Write commands looks at "who" is in the "who -uR" output and will only be able to write to the UID in that output.
Now if you open another session in mars by login directly as oracle, write command will work because it sees it in "who -uR".
Hope I'm not confusing you :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2002 03:35 AM
04-29-2002 03:35 AM
Re: Could anyone explain it for me ?
the perhaps simplest explanation is that "who" show who is LOGGED-IN, but "su" does not log-in, but "switch" to the user-id. And as "su" does not enter that piece of information into the "/var/adm/wtmp" (the file read by "who"), "who" cannot know.
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2002 04:41 AM
04-29-2002 04:41 AM
Re: Could anyone explain it for me ?
As pr the man page whoami will 'print effective current user id' whereas who 'examines the /etc/utmp file to obtain its information'.
Regards,
Trond
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2002 02:58 PM
04-29-2002 02:58 PM
Re: Could anyone explain it for me ?
use "id" instead - it is shorter and tells you your effective user-id!
Regards,
Wodisch