Assigning IP's

hi all,

i want to know where i can add and IP address so when i do a "w", i can see what IP is assigned to which tty? i know in tru64 you just added an entry to /etc/hosts. this does not seem to be the case with hpux.

thanks

type: who

HTH

Cheers,
Cameron

thanks cameron but that doesn't tell me how to assign an IP to each specific tty?

eh?

Which IP addresses are you talking about?

ttys are not assigned to IP addresses unless you are refering to slip or ppp connections.

when an IP telnets into the box I want to be able to assign a name to that IP so I can see the name logged in when I use w/finger.

You mean the /etc/hosts file? That does name to address and vice versa mapping.

correct, but I've added an entry in there but it does not show.

Do you have an /etc/nsswitch.conf file?

no /etc/nsswitch.conf file found

I do not have a HP-UX system to hand at the moment, but looking at the HP-UX doc set for HP-UX 11i 1.5, I do not see a 'w' utility listed. Is this an alias for the who utility?

The who utility examines the /var/adm/utmp file. The HP-UX man page for utmp(4) shows that it has an entry for hostname and IP address if remote.

     char	       ut_host[16];		/* host name,if remote*/
     unsigned long  ut_addr;	              /* host Internet addr, if remote*/

S

from man page:
w is linked to uptime and prints the same output as uptime -w
-w Print a summary of the current activity on the system for
each user. This is the default for the w command.

You can't get what you're looking for with 'w'

I'm rather unclear on what it is you did to /etc/hosts, and the exact output you're looking for. If you have in /etc/hosts then one would think you would see the hostname, not the IP address in what you're output would be.

who -R will show you the remote connections, and the tty's, however if the IP address in know, either via, hosts, DNS, etc the actual hostname would be displayed, and only when it's completely unknown would the IP be displayed. Perhaps this is what you're looking for?

thanks denn, "who -R" is exactly what I'm looking for, you see, for certain applications we have one login to do various batch jobs with multiple people using that one login, "who -R" allows me to see the IP's logged in and assign a name to each persons IP so I can see exactly which person is doing what with that one login. (hope this is making sense??????) :slight_smile: :slight_smile: :slight_smile:

*cough*, can't be `who`. :wink: