Networking Forums

Networking Forums > Computer Networking > Linux Networking > Finding the NODE NAME or IP

Reply
Thread Tools Display Modes

Finding the NODE NAME or IP

 
 
Dr. Lince M. Lawrence
Guest
Posts: n/a

 
      05-27-2004, 08:50 AM
I am working in a Linux network, with more than 50 nodes.
From my node I login to various machines/nodes for the conveniences of
access.

Now my question is; I have logged in to another system in the network from
my machine/node. Once I am logged in to another system, how can I know the
name of my system (or my IP address)

I am aware that by typing in "w $USER" I can get the log, but, what should
I do to get just my node name or IP address; and nothing else.

I am requesting this so that this could be used in shell scripting, to
identify the local node.

Thanks,
Lince M Lawrence
 
Reply With Quote
 
 
 
 
Sven Vermeulen
Guest
Posts: n/a

 
      05-27-2004, 08:56 AM
On 27 May 2004 01:50:43 -0700, Dr. Lince M. Lawrence <(E-Mail Removed)> wrote:
> Now my question is; I have logged in to another system in the network from
> my machine/node. Once I am logged in to another system, how can I know the
> name of my system (or my IP address)


The name can be returned with the hostname command. The IP is obtainable using
ifconfig.

Wkr,
Sven Vermeulen

--
Bent Hindrup Andersen, Danish MEP, about the Software Patent Directive:
The approach of the Commission and Council in this directive is shocking.
They are making full use of all the possibilities of evading democracy that
the current Community Law provides. <http://lwn.net/Articles/84009/>
 
Reply With Quote
 
Marco Dieckhoff
Guest
Posts: n/a

 
      05-27-2004, 09:33 AM
On 2004-05-27, Sven Vermeulen <(E-Mail Removed)> wrote:
> On 27 May 2004 01:50:43 -0700, Dr. Lince M. Lawrence <(E-Mail Removed)> wrote:
>> Now my question is; I have logged in to another system in the network from
>> my machine/node. Once I am logged in to another system, how can I know the
>> name of my system (or my IP address)

>
> The name can be returned with the hostname command. The IP is obtainable using
> ifconfig.


I think he meant the name of his "local" system, where the login
came from.

Lince:
As "w" prints out this information just "sed"ate it.

Maybe better way, esp. if there are more logins from one user:
SSH declares two variables:

SSH_CLIENT="192.168.1.232 2016 22"
SSH_CONNECTION="192.168.1.232 2016 192.168.1.230 22"

This is a login from my local box 192.168.1.232 to my mailserver
192.168.1.230.

--
Marco Dieckhoff
icq# 22243433
GPG Key 0x1A6C95BA -- http://www.frankonia-brunonia.de/keys
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When To Add A Node John Spalding Windows Networking 1 07-21-2008 03:02 PM
Pb rdp on nlb node Marc Windows Networking 0 11-01-2006 12:06 PM
Wireless node Alt Wireless Internet 3 09-08-2004 01:09 AM
Direct node to node communication Sinep Wireless Internet 1 12-27-2003 10:39 AM
cannot ssh from master node to slave node in cluster Yeo Linux Networking 0 09-09-2003 05:47 AM



1 2 3 4 5 6 7 8 9 10 11