Seeing different output from who -u in global INIT and local SRP

Thread Tools Search this Thread
Operating Systems HP-UX Seeing different output from who -u in global INIT and local SRP
# 1  
Old 07-01-2010
Seeing different output from who -u in global INIT and local SRP

I am seeing different output from "who -u" when we execute "who -u" in global INIT and local SRP after calling telnet, rlogin and remsh. We are not seeing correct output when we login to local SRP using telnet, rlogin and remsh.
srp_init just creates an UTMP entry in the UTMP database. Based my knowledge telnetd, rlogind and remshd and login fills the entry along with e_exit value when they create a session.
Based on our analysis ...
It is true that who -r will be showing entries from local utmp database that are updated by telnetd, rlogind and remshd based on e_exit value that is being set in the utmp entry.
From who command source, if e_exit=1 then who command thinks it has a "tty" rather then a "pty" and it won't display what we have written for e_host, instead the who command will retrieve the local hostname and display it. hence when we run who -u in local host instead of remote host name we could see a local host name.
For testing when we change the local SRP hostname to "foo" then the output of "who -u" displayed "foo"
Then I compiled a modified version of the "who" command that ignored the e_exit field can correctly display the e_host field (which is the name of the remote host that the telnetd or rlogin originated from).
I assume telnetd, rlogind, remshd /login will add an utmp entry when they create a session and also they set e_exit value. Could you please verify what value do they set in the local SRP for e_exit?
Seems to be telnetd, rlogind, remshd /login are writing utmp entries with e_exit = 1 even for pseudo pty's is that correct behavior?
In our srp init, we check pty or tty to set the e_exit value.
While we telnet into global we run "who –u" the output is after telnet from remote machine to global INIT
# who -u
root console Jun 17 11:39 0:01 2305 system console
root pts/ta Jun 23 12:29 . 12179

While we telnet into local SRP we run "who -u" the output is
# who -u
root pts/ta Jun 23 12:30 . 12236 hpindwqz

"rlogin" and "remsh" commands have the same problem.
But command "ssh" works well.
root@hpindhqc $ ssh hpindwqz
The authenticity of host 'hpindwqz (' can't be established.
RSA key fingerprint is 89:1d:6c:43:fc:cc:c8:42:b7:65:3b:a9:ab:40:7b:6e.
Are you sure you want to continue connecting (yes/no)? yes
# hostname
# who -u
root pts/0 Jun 24 06:05 . 5852

Please respond.Any suggestion would be appreciated.
Madhur Tripathi

Last edited by vbe; 07-02-2010 at 12:36 PM.. Reason: rm colors added code tags + typos...
# 2  
Old 07-02-2010
It is true that who -r will be showing entries from local utmp database that are updated by telnetd
Not " who -R " ?

---------- Post updated at 18:40 ---------- Previous update was at 17:07 ----------

Wouldnt some explanation be found in:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

init-script failing because of /etc/rc.d/init.d/functions

I encountered a problem on one of our database servers. OS: CentOS 5.5 final Kernel: 2.6.18-238.5.1.el5.028stab085.2 (OpenVZ kernel) We wrote some DB-Start/Stop-scripts ("/db2/admin/scripts_dba/start_services.ksh" and ".../stop_services.ksh") to start the database instances. (Database... (1 Reply)
Discussion started by: bakunin
1 Replies

2. Solaris

Covert Global zone to local zone

Dears, I would like to convert solaris 10 x86 and solaris 10 sparc (Global Zones) physical servers into Local zones. i found a document which seems to be helpful but i'm stuck @ the 1st step. to test this i want to do it 1st on x86 system running under vmware ESXi and if it succeeds i will... (1 Reply)
Discussion started by: mduweik
1 Replies

3. UNIX for Dummies Questions & Answers

Global - Local script??

Hi, I have a script which can be called from any path on the machine. It kind of acts like a global script. How do I achive this? :confused: The path from which I call it is different from the path where it exists. (where <script name> ) Thanks and Regards, Preetham R. (1 Reply)
Discussion started by: preethgideon
1 Replies

4. Linux

How to I change init levels after typing init 1

Dear all, I typed in init 1 on my redhat box as root and according to wikipedia ( 1 Single-User Mode Does not configure network interfaces, start daemons, or allow non-root logins So now I can't connect back to it. How do I change the init back to 3?... (8 Replies)
Discussion started by: z1dane
8 Replies

5. Solaris

sharing a directory between local and global zone

is this the step? add fs set dir=/export set special=/export set type=lofs add options rw end i notice i can't post immediately, moderator needs to moderate. i have 1 more post still haven't appear in the forum..hmm.... (1 Reply)
Discussion started by: binary0011
1 Replies

6. Solaris

Not able to ping global zone from local zone

Hi Gurus I am not able to ping the local zone from global zone when i am trying to ping i am getting below ICMP Host Unreachable from gateway zone ( for icmp from zone ( to sun1 ( However i can ping local zone from global please... (12 Replies)
Discussion started by: kumarmani
12 Replies

7. Shell Programming and Scripting

Problem with global and local variables

Guys, how can I define global variables in sorlaris...cause I lose the values outside the scope. Rite now wat I do is,I redirect variable value to a file n then get it back outside the function...:o....theres obviously a better way of doing this...I now this is a basic question....but please... (2 Replies)
Discussion started by: qzv2jm
2 Replies

8. Programming

Reg. Local vs Global declarations

Please go through the following two versions of code :- Version 1 --- string1 and string2 declared as Global variables The output is :-- (as expected sprintf is overwriting the first byte of string2 with NULL) string1=send string2= #include <stdio.h> char string1; char string2; main()... (2 Replies)
Discussion started by: kms
2 Replies

9. Shell Programming and Scripting

Global variable becomes local

I have encountered a very weird behavior of a global variable in Korn Shell in AIX: A function f1 in my script pipes the output of the function f2 to a program. A variable defined as global using typeset gets its value in f2. That value is not seen in f1. If I remove the pipe ksh recognizes the... (2 Replies)
Discussion started by: odashe318
2 Replies
Login or Register to Ask a Question

Featured Tech Videos