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
Code:
# who -u
root console Jun 17 11:39 0:01 2305 system console
root pts/ta Jun 23 12:29 . 12179 yc4.americas.hpqcorp.net
While we telnet into local SRP we run "who -u" the output is
Code:
# who -u
root pts/ta Jun 23 12:30 . 12236 hpindwqz
"rlogin" and "remsh" commands have the same problem.
But command "ssh" works well.
Code:
root@hpindhqc $ ssh hpindwqz
The authenticity of host 'hpindwqz (16.92.109.105)' 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
hpindwqz
# who -u
root pts/0 Jun 24 06:05 . 5852 hpindhqc.cup.hp.com
Please respond.Any suggestion would be appreciated.
Thanks
Regards
Madhur Tripathi
Last edited by vbe; 07-02-2010 at 11:36 AM..
Reason: rm colors added code tags + typos...
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)
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)
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)
Dear all,
I typed in init 1 on my redhat box as root and according to wikipedia (http://en.wikipedia.org/wiki/Runlevel):
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)
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)
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 ( 192.268.35.210)
for icmp from zone ( 192.168.35.210) to sun1 ( 192.168.35.210)
However i can ping local zone from global
please... (12 Replies)
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)
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)
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)