LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (http://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   result o WHO command (http://www.linuxquestions.org/questions/solaris-opensolaris-20/result-o-who-command-4175448974/)

charanjaitu 02-07-2013 01:07 AM

result o WHO command
 
Hi

I logged to a server having sunOS via putty and run the WHO command.
the result it gave me the with my local IP.
Again I logged to the same server via putty from some other terminal.
again i run the who command, it gave me some other IP. It did not give the local IP of that terminal. Ideally it should give the local IP.
can someone explain me


CDS

chrism01 02-07-2013 01:39 AM

It can only give the IP it can see; maybe that 'terminal' eg Pc is natted.

shivaa 02-07-2013 12:39 PM

Quote:

Originally Posted by charanjaitu (Post 4886031)
Again I logged to the same server via putty from some other terminal.

Can you exxplain it little more, how did you login into same server via putty from some other terminal?
Did you try this using some other PC?

charanjaitu 02-08-2013 03:48 AM

yes, i logged using some other PC.

shivaa 02-08-2013 04:58 AM

Quote:

Originally Posted by charanjaitu (Post 4886857)
yes, i logged using some other PC.

A terminal do not have any IP or hostname, but the machine from where you're connected and running the terminal, has an IP and hostname.

Two different PCs will obviously have different IPs. So who is giving correct results.

Since you tried to connect to a remote server from two different PCs, so who showed you two different IPs.

charanjaitu 02-11-2013 01:00 AM

Hi Shivaa

yes, I know that, but the 'Who' command is not showing the IP that it ought to.
Who is showing some other IP.
in this case, when I execute ifconfig command , it shows its IP as 10.0.0.1(just saying)
while who command shows it being connected to some other IP 10.1.5.26


CDS

shivaa 02-11-2013 01:46 AM

ifconfig retuns ip address of the machine where you're logged in, not for the system from where you're logged in.

To me, it seems that result is just confusing you. So can you once check output of following cmds:
Code:

~$ who --ips      # Prints ip adress
~$ who --lookup  # Prints hostnaame
~$ who -m        # Only hostname
~$ w

Also what command line option(s) you tried with who? And what's impact of these result on your work.

charanjaitu 02-11-2013 11:52 PM

Hey Shivaa

Thanks for your support.The server has been put on upgrade mode. So i cant access it for next 1-2 days. Will surely put my results here once it goes up

Thank you

jlliagre 02-12-2013 09:33 AM

Quote:

Originally Posted by shivaa (Post 4888884)
So can you once check output of following cmds:
Code:

~$ who --ips      # Prints ip adress
~$ who --lookup  # Prints hostnaame
~$ who -m        # Only hostname
~$ w


Beware that these are GNU who specific extensions unavailable with the standard SVR4 who provided with Solaris.

charanjaitu 02-18-2013 04:16 AM

1 Attachment(s)
Hi Shivaa
so this is the fresh result of who command:

so In line1 , user1 is my computer and result is correct
In Linw 2, I again logged with same username from someother computer, and who command gives 11.11.11.11 as IP, but while running ifconfig command , the Ip is something else(11.11.11.12 lets say)

I checked some different thing in line 3, the Ip field something (:1.0)


Charan

PS: Shivaa,the commands suggested by you are not working on my server environment

shivaa 02-18-2013 07:50 AM

Let's assume that you've connected on Server-A from Server-B and Server-C.
You then invoked who cmd on Server-A and got the results as shown in screenshot.

So let me explain, pts stands for psudo terminal type device i.e. it indicates that you're connected on Server-A from some remote system i.e. Server-B or Server-C. Then following to it, an IP address is actually IP address of the remote machine i.e. either Server-B or Server-C.

So,
10.10.10.10 is IP address of Server-B.
And,
11.11.11.11 is IP address of Server-C.
And,
In third case, where you can see a 1:0, is nothing but a local xterm with DISPLAY number 1 and instance no. 0. It's an xterm opened from Server-A itself. Therefore there's no IP, but only DISPLAY value is showing.

Then run following commands on Server-B and Server-C to check their corresponding IPs. Server-B should have 10.10.10.10 and Server-C should have 11.11.11.11
Code:

~$ ifconfig -a            # Run on Server-B and Server-C
~$ nslookup Server-B      # Run from Server-A or Server-C
~$ nslookup Server-C      # Run from Server-A or Server-B

Quote:

Shivaa, the commands suggested by you are not working on my server environment.
They're GNU specific commands line options, so please refer man page of who for it's associated options.
Code:

~$ man who


All times are GMT -5. The time now is 08:36 AM.