LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 02-07-2013, 01:07 AM   #1
charanjaitu
LQ Newbie
 
Registered: Apr 2010
Location: Jaitu
Distribution: CentOS
Posts: 29

Rep: Reputation: 0
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
 
Old 02-07-2013, 01:39 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
It can only give the IP it can see; maybe that 'terminal' eg Pc is natted.
 
1 members found this post helpful.
Old 02-07-2013, 12:39 PM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by charanjaitu View Post
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?

Last edited by shivaa; 02-08-2013 at 04:51 AM.
 
Old 02-08-2013, 03:48 AM   #4
charanjaitu
LQ Newbie
 
Registered: Apr 2010
Location: Jaitu
Distribution: CentOS
Posts: 29

Original Poster
Rep: Reputation: 0
yes, i logged using some other PC.
 
Old 02-08-2013, 04:58 AM   #5
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by charanjaitu View Post
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.
 
Old 02-11-2013, 01:00 AM   #6
charanjaitu
LQ Newbie
 
Registered: Apr 2010
Location: Jaitu
Distribution: CentOS
Posts: 29

Original Poster
Rep: Reputation: 0
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
 
Old 02-11-2013, 01:46 AM   #7
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
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.
 
1 members found this post helpful.
Old 02-11-2013, 11:52 PM   #8
charanjaitu
LQ Newbie
 
Registered: Apr 2010
Location: Jaitu
Distribution: CentOS
Posts: 29

Original Poster
Rep: Reputation: 0
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
 
Old 02-12-2013, 09:33 AM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,493

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
Originally Posted by shivaa View Post
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.
 
Old 02-18-2013, 04:16 AM   #10
charanjaitu
LQ Newbie
 
Registered: Apr 2010
Location: Jaitu
Distribution: CentOS
Posts: 29

Original Poster
Rep: Reputation: 0
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
Attached Images
File Type: jpg 123.JPG (7.2 KB, 2 views)
 
Old 02-18-2013, 07:50 AM   #11
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
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

Last edited by shivaa; 02-18-2013 at 08:02 AM.
 
1 members found this post helpful.
  


Reply

Tags
putty, remote login


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I execute a shell command and put the result in command field? fran4tw Linux - General 9 08-08-2011 08:27 PM
[SOLVED] Grep for the result of a command within the result of another command jasonws Programming 6 11-18-2010 02:39 PM
How to pass the result of a command to another command (like grep) desb01 Programming 4 06-25-2009 12:09 PM
command result as varible mkiler Programming 1 03-10-2009 10:22 AM
BASH Command Result redhatnoob Programming 2 08-19-2004 06:25 PM


All times are GMT -5. The time now is 05:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration