Hi,
I guess it is a very simple question, however I am stuck.
I use "who am i" with 2 differnt logins on the same machine, and here
is what I get
lsfadmin@cbmccusbslretail1d:/export/home/lsfadmin> who am i
lsfadmin pts/11 Mar 7 08:17 (10.4.186.74)
batchuid_dev@cbmccusbslretail1d:/apps/sas/users/batchuid_dev> who am i
batchuid_dev /dev/pts/3 Mar 7 08:56
Why don't I get ip for my terminal for the second user id?
I will appereciate any help.
Thanks
Omer
|
|
0
|
|
|
|
Reply
|
zubairom (4)
|
3/7/2006 1:58:12 PM |
|
zubairom@gmail.com wrote:
> I guess it is a very simple question, however I am stuck.
>
> I use "who am i" with 2 differnt logins on the same machine, and here
> is what I get
>
> lsfadmin@cbmccusbslretail1d:/export/home/lsfadmin> who am i
> lsfadmin pts/11 Mar 7 08:17 (10.4.186.74)
>
> batchuid_dev@cbmccusbslretail1d:/apps/sas/users/batchuid_dev> who am i
> batchuid_dev /dev/pts/3 Mar 7 08:56
>
> Why don't I get ip for my terminal for the second user id?
>
> I will appereciate any help.
That's what happens for an illegal name - batchuid_dev is longer than 8
characters. See "man useradd".
John Howells
|
|
0
|
|
|
|
Reply
|
John
|
3/7/2006 2:33:17 PM
|
|
John Howells wrote:
> zubairom@gmail.com wrote:
>> Why don't I get ip for my terminal for the second user id?
>>
>> I will appereciate any help.
>
> That's what happens for an illegal name - batchuid_dev is longer than 8
> characters. See "man useradd".
but utmpx.ut_user[] is defined in utmpx.h as
char ut_user[32]; /* user login name */
Perhaps it is just that the terminal session did not
record the utmpx.ut_host[] information.
|
|
0
|
|
|
|
Reply
|
Oscar
|
3/7/2006 2:45:17 PM
|
|
Oscar del Rio wrote:
>
> John Howells wrote:
> > zubairom@gmail.com wrote:
>
> >> Why don't I get ip for my terminal for the second user id?
> >>
> >> I will appereciate any help.
> >
> > That's what happens for an illegal name - batchuid_dev is longer than 8
> > characters. See "man useradd".
>
> but utmpx.ut_user[] is defined in utmpx.h as
> char ut_user[32]; /* user login name */
>
> Perhaps it is just that the terminal session did not
> record the utmpx.ut_host[] information.
Just "who" will show the host information just fine, so that is not
correct. However, checking
http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/who/who.c you will
find that at line 400 it uses the cuserid function, and that returns a
name using only the allowed limit of eight characters, so that at line
731 et seq it cannot find a match for the longer user name that is
stored in the utmpx file, and thus it drops through to line 776 and
displays the short form noted. QED. The perils of using invalid names.
John Howells
|
|
0
|
|
|
|
Reply
|
John
|
3/8/2006 7:54:52 AM
|
|
Thanks for the help. Looks like it is the invalid name issue......
Is there any other way I can extract the login terminal information? At
this point it is not possible for me to change the name as it is being
used by many users
|
|
0
|
|
|
|
Reply
|
zubairom
|
3/8/2006 8:12:57 PM
|
|
zubairom@gmail.com wrote:
>
> Thanks for the help. Looks like it is the invalid name issue......
>
> Is there any other way I can extract the login terminal information? At
> this point it is not possible for me to change the name as it is being
> used by many users
Better rename now and become legitimate, whatever the minor
inconveniences might be, but you could try something like:
#! /bin/ksh
tty=$( tty | cut -d/ -f3,4 )
who | grep " $tty " | cut -d'(' -f2 | cut -d')' -f1
noting that you *CANNOT* merge the two lines into something like:
who | grep " $( tty | cut -d/ -f3,4 ) " | cut ....
as then stdin is not the original tty.
John Howells
|
|
0
|
|
|
|
Reply
|
John
|
3/9/2006 8:35:14 AM
|
|
Thanks John, this worked.
I will rename the account, eventualy, but I can not for at least next
few weeks, as the developers are in an intensive phase.....
Thanks a lot for your help
|
|
0
|
|
|
|
Reply
|
zubairom
|
3/9/2006 3:24:59 PM
|
|
|
6 Replies
302 Views
(page loaded in 0.962 seconds)
Similiar Articles: error: can't open display - comp.unix.solarisFrom the same terminal window Telnet to the server machine ... You could set the DISPLAY variable to the IP address: $ who am i This should give you the IP address ... exceed: can't open display - comp.unix.solaris... export DISPLAY={ip address of first ... in putty |> | terminal: xterm Xt error: Can't open display: {ip address of ... can't open display - comp.unix.solaris... xterm i am ... Virtual IP setup Problem - comp.os.linux.networkingI am trying to run multiple network nodes (A, B, C, D and E). Each node requires unique IP address to be assigned. ... from the outside network gets displayed ... how to enable passwordless access for rsh rcp - comp.unix.solaris ...Then, on the remote system, type who am i this should display the something like root <terminal device ... etc/hosts file or in NIS or DNS, you'll see an IP address ... Error: Can't open display - comp.unix.solarisI am sure there are less expensive solutions ... need to tell the remote Sun box about the PC. DISPLAY=<IP-address ... to run a x-program (like xeyes) from the PuTTY terminal ... set proxy host/port ??? - comp.lang.java.programmerYou may be able to set the DISPLAY ... is a plausible ... the virtual server on port 8000 to the zone's IP address. ... proxy host/port ??? - comp.lang.java.programmer I am ... port listen/send - comp.lang.javascript... be broadcast from the server arbitrarily and displayed by ... Reply: Erwin: 9/17/2005 7:37:29 AM ... We have got a NAT IP address and a open port 1521, But ... ssh tunelling X11 error - comp.unix.solarishello there, I am using solaris 10 on my sun ... DISPLAY"? > > Brad hi brad. on typin echo $DISPLAY at the terminal i ... fonts.dir > > > Incorrect font server address or ... Modify Date of a Router Configuration file - comp.dcom.sys.cisco ...... 20:00 Or by a NTP Server: ntp <IP address ... config' gives you the desired information, so you could set the terminal ... Cisco Ip Phones time display problem - comp.dcom.sys ... ssh x11 forwarding - comp.security.unixdebug2: channel 0: request x11-req confirm 0 So i am ... XDarwin server X ), echo $DISPLAY : :0.0 In the terminal Macos, export DISPLAY=:0.0 cd ssh FreeBSD.IP -l ... What Is My IP Address? Lookup IP, Hide IP, Change IP, Trace IP and ...IP address lookup, location, proxy detection, email tracing, IP hiding tips, blacklist check, speed test, and forums. Find, get, and show my IP address. How can I know IP address of terminal? - The UNIX and Linux ForumsHi all, I am new in Unix world. I usually need to trace who connect to which terminal by IP address. ... Search this Thread: Display Modes # 7/26/2012 7:13:03 AM
|