D3 / AIX Login problem

D3 / AIX Login problem

Post by Barr » Fri, 25 Jul 2003 07:59:33



Hi Guru's

Problem:

AIX server running multiple D3 virtual machines
on the one physical machine.
AIX server running single quad network card.
Users connect to D3 using 4 unique ip addresses.

Question:

Does anyone know of a way to retrieve the users ip address
when they telnet into AIX.

I need / would like to be able to automatically direct the
login to a specific VM based on the ip address of the telnet
connection.

Does anyone have any thoughts, I am fresh out of ideas.

Regards Barry

 
 
 

D3 / AIX Login problem

Post by Dan El » Fri, 25 Jul 2003 09:25:47


who -m will return the ip address of the connection.  You can then use a
script to finger out which machine to run.


Quote:> Hi Guru's

> Problem:

> AIX server running multiple D3 virtual machines
> on the one physical machine.
> AIX server running single quad network card.
> Users connect to D3 using 4 unique ip addresses.

> Question:

> Does anyone know of a way to retrieve the users ip address
> when they telnet into AIX.

> I need / would like to be able to automatically direct the
> login to a specific VM based on the ip address of the telnet
> connection.

> Does anyone have any thoughts, I am fresh out of ideas.

> Regards Barry


 
 
 

D3 / AIX Login problem

Post by Art Mart » Fri, 25 Jul 2003 09:41:33


On my D3/Aix, a telnet into the default telnet port 23 returns:

root        pts/0       Jul 23 20:37    (::ffff:192.168.1)

192.168.1 is *NOT* the working IP address on this machine. The same
thing from a nailed telnet port returns nothing. FWIW, from a serially
connected green screen, who -m returns:

root       tty128

Art


> who -m will return the ip address of the connection.  You can then use a
> script to finger out which machine to run.



>>Hi Guru's

>>Problem:

>>AIX server running multiple D3 virtual machines
>>on the one physical machine.
>>AIX server running single quad network card.
>>Users connect to D3 using 4 unique ip addresses.

>>Question:

>>Does anyone know of a way to retrieve the users ip address
>>when they telnet into AIX.

>>I need / would like to be able to automatically direct the
>>login to a specific VM based on the ip address of the telnet
>>connection.

>>Does anyone have any thoughts, I am fresh out of ideas.

>>Regards Barry

 
 
 

D3 / AIX Login problem

Post by Dan El » Fri, 25 Jul 2003 09:52:29


Do you want the user's ip address or the ip address the user used to get to
the box? Green screens of course have no telnet address and nailed telnet
will not return output of a unix command.  But, after re-reading your email
I'm not sure what you want; do you want what address they are telnetting to
or from?


> On my D3/Aix, a telnet into the default telnet port 23 returns:

> root        pts/0       Jul 23 20:37    (::ffff:192.168.1)

> 192.168.1 is *NOT* the working IP address on this machine. The same
> thing from a nailed telnet port returns nothing. FWIW, from a serially
> connected green screen, who -m returns:

> root       tty128

> Art


> > who -m will return the ip address of the connection.  You can then use a
> > script to finger out which machine to run.



> >>Hi Guru's

> >>Problem:

> >>AIX server running multiple D3 virtual machines
> >>on the one physical machine.
> >>AIX server running single quad network card.
> >>Users connect to D3 using 4 unique ip addresses.

> >>Question:

> >>Does anyone know of a way to retrieve the users ip address
> >>when they telnet into AIX.

> >>I need / would like to be able to automatically direct the
> >>login to a specific VM based on the ip address of the telnet
> >>connection.

> >>Does anyone have any thoughts, I am fresh out of ideas.

> >>Regards Barry

 
 
 

D3 / AIX Login problem

Post by Jeffrey Kaufma » Fri, 25 Jul 2003 10:50:20


From a serial port or a nailed telnet, simple check the port# using

CHANNEL.NO = FIELD(OCONV(0,"U50BB")," ",1)

and compare it to a range. E.g. port 1-20 go to this virtual, etc.

Sorry I cannot help on the floating pibs.

--

Jeffrey Kaufman
Key Data Systems Group
www.keydata.us
559-432-3832
559-432-4657 fax

Western Pacific Supply
www.westpacsupply.com
888-WestPac


> Do you want the user's ip address or the ip address the user used to get
to
> the box? Green screens of course have no telnet address and nailed telnet
> will not return output of a unix command.  But, after re-reading your
email
> I'm not sure what you want; do you want what address they are telnetting
to
> or from?



> > On my D3/Aix, a telnet into the default telnet port 23 returns:

> > root        pts/0       Jul 23 20:37    (::ffff:192.168.1)

> > 192.168.1 is *NOT* the working IP address on this machine. The same
> > thing from a nailed telnet port returns nothing. FWIW, from a serially
> > connected green screen, who -m returns:

> > root       tty128

> > Art


> > > who -m will return the ip address of the connection.  You can then use
a
> > > script to finger out which machine to run.



> > >>Hi Guru's

> > >>Problem:

> > >>AIX server running multiple D3 virtual machines
> > >>on the one physical machine.
> > >>AIX server running single quad network card.
> > >>Users connect to D3 using 4 unique ip addresses.

> > >>Question:

> > >>Does anyone know of a way to retrieve the users ip address
> > >>when they telnet into AIX.

> > >>I need / would like to be able to automatically direct the
> > >>login to a specific VM based on the ip address of the telnet
> > >>connection.

> > >>Does anyone have any thoughts, I am fresh out of ideas.

> > >>Regards Barry

 
 
 

D3 / AIX Login problem

Post by Art Mart » Fri, 25 Jul 2003 10:43:28


Good question! But since I didn't ask the original question, I believe
I'll wait for Barry to answer you. But since you pointed it out, the
laptop I'm telnetting from *IS* dynamically assigned by a cable router,
and *DOES* start with the 192.168.1 address. IP config reveals
192.168.1.12. Interesting that who returned everything except the part
that changes each time.

Art


> Do you want the user's ip address or the ip address the user used to get to
> the box? Green screens of course have no telnet address and nailed telnet
> will not return output of a unix command.  But, after re-reading your email
> I'm not sure what you want; do you want what address they are telnetting to
> or from?



>>On my D3/Aix, a telnet into the default telnet port 23 returns:

>>root        pts/0       Jul 23 20:37    (::ffff:192.168.1)

>>192.168.1 is *NOT* the working IP address on this machine. The same
>>thing from a nailed telnet port returns nothing. FWIW, from a serially
>>connected green screen, who -m returns:

>>root       tty128

>>Art


>>>who -m will return the ip address of the connection.  You can then use a
>>>script to finger out which machine to run.



>>>>Hi Guru's

>>>>Problem:

>>>>AIX server running multiple D3 virtual machines
>>>>on the one physical machine.
>>>>AIX server running single quad network card.
>>>>Users connect to D3 using 4 unique ip addresses.

>>>>Question:

>>>>Does anyone know of a way to retrieve the users ip address
>>>>when they telnet into AIX.

>>>>I need / would like to be able to automatically direct the
>>>>login to a specific VM based on the ip address of the telnet
>>>>connection.

>>>>Does anyone have any thoughts, I am fresh out of ideas.

>>>>Regards Barry

 
 
 

D3 / AIX Login problem

Post by Barr » Sat, 26 Jul 2003 05:24:54



> who -m will return the ip address of the connection.  You can then use a
> script to finger out which machine to run.



> > Hi Guru's

> > Problem:

> > AIX server running multiple D3 virtual machines
> > on the one physical machine.
> > AIX server running single quad network card.
> > Users connect to D3 using 4 unique ip addresses.

> > Question:

> > Does anyone know of a way to retrieve the users ip address
> > when they telnet into AIX.

> > I need / would like to be able to automatically direct the
> > login to a specific VM based on the ip address of the telnet
> > connection.

> > Does anyone have any thoughts, I am fresh out of ideas.

> > Regards Barry

Thanks Dan, that is exactly what I was looking for.

Have built the scripts, works well.

Thanks to all for responding

Regards Barry

 
 
 

D3 / AIX Login problem

Post by Patrick Pay » Sat, 26 Jul 2003 09:05:58


who -q -m   returned

bash-2.05a$ who -q -m
pa1371     (192.168.4.42)

The issue here is if you have name services running, the system will
report the domain name instead of the ip address.  If this happens you
will have to do a reverse lookup.

I was playing with netstat and you could even figure out what D3/Aix
ip address they are connecting to.

e.g.

bash-2.05a$ netstat -n -a | grep "192.168.4.42" | more
tcp4       0      0  192.168.4.31.telnet    192.168.4.42.1301    
ESTABLISHED


> Hi Guru's

> Problem:

> AIX server running multiple D3 virtual machines
> on the one physical machine.
> AIX server running single quad network card.
> Users connect to D3 using 4 unique ip addresses.

> Question:

> Does anyone know of a way to retrieve the users ip address
> when they telnet into AIX.

> I need / would like to be able to automatically direct the
> login to a specific VM based on the ip address of the telnet
> connection.

> Does anyone have any thoughts, I am fresh out of ideas.

> Regards Barry

 
 
 

D3 / AIX Login problem

Post by Art Mart » Sun, 27 Jul 2003 01:35:18


Hey!, netstat -n -a | grep "192.168.4.42" is COOL!

Doing netstat -n -a | grep "ESTABLISHED" shows you who's connected to
your system (at least on my Aix box the ESTABLISHED is on the same line
as the rest of it). If you want to see who is connected to a particular
nic on your system (if you have more than one), doing:

netstat -n -a | grep "(gateway)" where (gateway) is the ip address of
the nic card shows who's in on that nic.

In Patrick's example, the 192.168.4.31.telnet, on mine the "telnet" is
replaced with the nailed telnet port number. So I'd have something like
192.168.4.31.10100, where 10100 is the host port number, typically
associated with pick port 100. The number in the second column,
192.168.4.42.1301, does anybody know what the ".1301" means?

I *LIKE* it!  Thanks, Patrick!

Art


> who -q -m   returned

> bash-2.05a$ who -q -m
> pa1371     (192.168.4.42)

> The issue here is if you have name services running, the system will
> report the domain name instead of the ip address.  If this happens you
> will have to do a reverse lookup.

> I was playing with netstat and you could even figure out what D3/Aix
> ip address they are connecting to.

> e.g.

> bash-2.05a$ netstat -n -a | grep "192.168.4.42" | more
> tcp4       0      0  192.168.4.31.telnet    192.168.4.42.1301    
> ESTABLISHED


>>Hi Guru's

>>Problem:

>>AIX server running multiple D3 virtual machines
>>on the one physical machine.
>>AIX server running single quad network card.
>>Users connect to D3 using 4 unique ip addresses.

>>Question:

>>Does anyone know of a way to retrieve the users ip address
>>when they telnet into AIX.

>>I need / would like to be able to automatically direct the
>>login to a specific VM based on the ip address of the telnet
>>connection.

>>Does anyone have any thoughts, I am fresh out of ideas.

>>Regards Barry

 
 
 

D3 / AIX Login problem

Post by Art Mart » Sun, 27 Jul 2003 04:50:54


Here's a little quicky program I wrote to display networked users
similar to the listu verb. It makes 2 important assumptions, 1),
networked users are nailed telnet, and 2) the pick port number is the
last three digits of the telnet host number. Maybe somebody will find it
useful.

     SOURCE.IPS='' ; NEW.OUTPUT=''
     OPEN 'PIBS' TO PIBS.FILE ELSE STOP 201,'PIBS'
     EXECUTE '!netstat -n -a | grep "ESTABLISHED"' CAPTURING OUTPUT
     HEAD ='Remote IP':SPACE(15):'Network connected Users':SPACE(10)
     HEAD:='Local IP':SPACE(5):"'C'"

     FOR LOOP1 = 1 TO NUM.LINES
       LINE=TRIM(OUTPUT<LOOP1>) ; SOURCE.IP=FIELD(LINE,SPACE(1),5)
       IF FIELD(SOURCE.IP,'.',1) NE 127 THEN
         LOCATE SOURCE.IP IN SOURCE.IPS BY "AR" SETTING ATTR ELSE
           INS SOURCE.IP BEFORE SOURCE.IPS<ATTR>
           INS OUTPUT<LOOP1> BEFORE NEW.OUTPUT<ATTR>
         END
       END
     NEXT NUM.LINES

     FOR LOOP1 = 1 TO NUM.LINES
       LINE=TRIM(OUTPUT<LOOP1>) ; HOST.IP=FIELD(LINE,SPACE(1),4)
       SOURCE.IP=FIELD(LINE,SPACE(1),5)
       HOST.PORT=FIELD(HOST.IP,'.',5)[3,3]
       READV LOC FROM PIBS.FILE,HOST.PORT,1 ELSE LOC='n/a'
       PRINT SOURCE.IP "L#19 ":HOST.PORT:':':LOC "L#30 ":HOST.IP "L#20"
     NEXT NUM.LINES
   END

Art


> Hey!, netstat -n -a | grep "192.168.4.42" is COOL!

> Doing netstat -n -a | grep "ESTABLISHED" shows you who's connected to
> your system (at least on my Aix box the ESTABLISHED is on the same line
> as the rest of it). If you want to see who is connected to a particular
> nic on your system (if you have more than one), doing:

> netstat -n -a | grep "(gateway)" where (gateway) is the ip address of
> the nic card shows who's in on that nic.

> In Patrick's example, the 192.168.4.31.telnet, on mine the "telnet" is
> replaced with the nailed telnet port number. So I'd have something like
> 192.168.4.31.10100, where 10100 is the host port number, typically
> associated with pick port 100. The number in the second column,
> 192.168.4.42.1301, does anybody know what the ".1301" means?

> I *LIKE* it!  Thanks, Patrick!

> Art


>> who -q -m   returned

>> bash-2.05a$ who -q -m
>> pa1371     (192.168.4.42)

>> The issue here is if you have name services running, the system will
>> report the domain name instead of the ip address.  If this happens you
>> will have to do a reverse lookup.

>> I was playing with netstat and you could even figure out what D3/Aix
>> ip address they are connecting to.

>> e.g.

>> bash-2.05a$ netstat -n -a | grep "192.168.4.42" | more
>> tcp4       0      0  192.168.4.31.telnet    192.168.4.42.1301    
>> ESTABLISHED



>>> Hi Guru's

>>> Problem:

>>> AIX server running multiple D3 virtual machines
>>> on the one physical machine.
>>> AIX server running single quad network card.
>>> Users connect to D3 using 4 unique ip addresses.

>>> Question:

>>> Does anyone know of a way to retrieve the users ip address
>>> when they telnet into AIX.
>>> I need / would like to be able to automatically direct the login to a
>>> specific VM based on the ip address of the telnet
>>> connection.

>>> Does anyone have any thoughts, I am fresh out of ideas.

>>> Regards Barry

 
 
 

D3 / AIX Login problem

Post by Patrick Pay » Sun, 27 Jul 2003 07:44:39


I believe (a guess) that it is the tcp port the client is using to go
out on.  I believe TCP does this dynamically and can/should always be
different.

- Patrick


> Hey!, netstat -n -a | grep "192.168.4.42" is COOL!

> Doing netstat -n -a | grep "ESTABLISHED" shows you who's connected to
> your system (at least on my Aix box the ESTABLISHED is on the same line
> as the rest of it). If you want to see who is connected to a particular
> nic on your system (if you have more than one), doing:

> netstat -n -a | grep "(gateway)" where (gateway) is the ip address of
> the nic card shows who's in on that nic.

> In Patrick's example, the 192.168.4.31.telnet, on mine the "telnet" is
> replaced with the nailed telnet port number. So I'd have something like
> 192.168.4.31.10100, where 10100 is the host port number, typically
> associated with pick port 100. The number in the second column,
> 192.168.4.42.1301, does anybody know what the ".1301" means?

> I *LIKE* it!  Thanks, Patrick!

> Art


> > who -q -m   returned

> > bash-2.05a$ who -q -m
> > pa1371     (192.168.4.42)

> > The issue here is if you have name services running, the system will
> > report the domain name instead of the ip address.  If this happens you
> > will have to do a reverse lookup.

> > I was playing with netstat and you could even figure out what D3/Aix
> > ip address they are connecting to.

> > e.g.

> > bash-2.05a$ netstat -n -a | grep "192.168.4.42" | more
> > tcp4       0      0  192.168.4.31.telnet    192.168.4.42.1301    
> > ESTABLISHED


> >>Hi Guru's

> >>Problem:

> >>AIX server running multiple D3 virtual machines
> >>on the one physical machine.
> >>AIX server running single quad network card.
> >>Users connect to D3 using 4 unique ip addresses.

> >>Question:

> >>Does anyone know of a way to retrieve the users ip address
> >>when they telnet into AIX.

> >>I need / would like to be able to automatically direct the
> >>login to a specific VM based on the ip address of the telnet
> >>connection.

> >>Does anyone have any thoughts, I am fresh out of ideas.

> >>Regards Barry

 
 
 

D3 / AIX Login problem

Post by Patrick Pay » Sun, 27 Jul 2003 07:46:09


FYI - I learned about the netstat command when tracking down hackers
and snooping programs.  You can see what applications are listening.
There is another switch that will show the actual executable.  I
trojan SSHD daemon sticks out.

- Patrick


> Hey!, netstat -n -a | grep "192.168.4.42" is COOL!

> Doing netstat -n -a | grep "ESTABLISHED" shows you who's connected to
> your system (at least on my Aix box the ESTABLISHED is on the same line
> as the rest of it). If you want to see who is connected to a particular
> nic on your system (if you have more than one), doing:

> netstat -n -a | grep "(gateway)" where (gateway) is the ip address of
> the nic card shows who's in on that nic.

> In Patrick's example, the 192.168.4.31.telnet, on mine the "telnet" is
> replaced with the nailed telnet port number. So I'd have something like
> 192.168.4.31.10100, where 10100 is the host port number, typically
> associated with pick port 100. The number in the second column,
> 192.168.4.42.1301, does anybody know what the ".1301" means?

> I *LIKE* it!  Thanks, Patrick!

> Art


> > who -q -m   returned

> > bash-2.05a$ who -q -m
> > pa1371     (192.168.4.42)

> > The issue here is if you have name services running, the system will
> > report the domain name instead of the ip address.  If this happens you
> > will have to do a reverse lookup.

> > I was playing with netstat and you could even figure out what D3/Aix
> > ip address they are connecting to.

> > e.g.

> > bash-2.05a$ netstat -n -a | grep "192.168.4.42" | more
> > tcp4       0      0  192.168.4.31.telnet    192.168.4.42.1301    
> > ESTABLISHED


> >>Hi Guru's

> >>Problem:

> >>AIX server running multiple D3 virtual machines
> >>on the one physical machine.
> >>AIX server running single quad network card.
> >>Users connect to D3 using 4 unique ip addresses.

> >>Question:

> >>Does anyone know of a way to retrieve the users ip address
> >>when they telnet into AIX.

> >>I need / would like to be able to automatically direct the
> >>login to a specific VM based on the ip address of the telnet
> >>connection.

> >>Does anyone have any thoughts, I am fresh out of ideas.

> >>Regards Barry

 
 
 

D3 / AIX Login problem

Post by Pete Jewel » Tue, 29 Jul 2003 22:09:30


On Fri, 25 Jul 2003 19:50:54 GMT


> Here's a little quicky program I wrote to display networked users
> similar to the listu verb. It makes 2 important assumptions, 1),
> networked users are nailed telnet, and 2) the pick port number is the
> last three digits of the telnet host number. Maybe somebody will find
> it useful.

In the interests of sharing, here's another one that doesn't rely on
nailed telnets :)

It was written for D3 7.1.0 on RedHat Linux 5.2, so if you're using a
different version of Linux you may have to make adjustments to it.

001 PROGRAM WHO.WHERE
002
003 * This program lists the users on a D3 system showing the machine their
004 * connection is from (if relevant).
005
006 * Original Author: Pete Jewell 28 September 2000
007
008 EQU AM TO CHAR(254), VM TO CHAR(253), SM TO CHAR(252)
009
010 EXECUTE "LISTU" CAPTURING LISTU.OUTPUT
011
012 LIST.COUNT = DCOUNT(LISTU.OUTPUT,AM)
013

015 CRT " PIB# PID... TTY.... IP ADDR........ UDATE UTIME ACCOUNT..."
016 CRT
017
018 FOR LINE.IDX = 3 TO LIST.COUNT
019   THIS.LINE = TRIM(LISTU.OUTPUT<LINE.IDX>)
020   CONVERT " " TO VM IN THIS.LINE
021   PIB = THIS.LINE<1,1>
022   IF PIB EQ "*" THEN
023     MY.LINE = "*"
024     PIB = THIS.LINE<1,2>
025     PID = THIS.LINE<1,3>
026     UDATE = THIS.LINE<1,5>
027     UTIME = THIS.LINE<1,6>
028     ACCOUNT = THIS.LINE<1,7>
029   END ELSE
030     MY.LINE = " "
031     PID = THIS.LINE<1,2>
032     UDATE = THIS.LINE<1,4>
033     UTIME = THIS.LINE<1,5>
034     ACCOUNT = THIS.LINE<1,6>
035   END
036  
037   IF NOT(NUM(PID)) THEN PID = 0
038  
039   IF PID THEN
040  
041     EXECUTE "!ps h ":PID CAPTURING PS.OUTPUT
042     PS.OUTPUT = TRIM(PS.OUTPUT)
043     CONVERT " " TO VM IN PS.OUTPUT
044     TTY = PS.OUTPUT<1,2>
045  
046     IF TTY NE "" THEN
047    
048       TTY = "tty":TTY
049       EXECUTE "!w|grep ":TTY CAPTURING W.OUTPUT
050       W.OUTPUT = TRIM(W.OUTPUT)
051       CONVERT " " TO VM IN W.OUTPUT
052    
053       IF TTY[1,4] NE "ttyp" THEN
054         IP.FROM = "<n/a>"
055       END ELSE
056         IP.FROM = W.OUTPUT<1,3>
057       END
058    
059     END ELSE
060       TTY = "unknown"
061       IP.FROM = "unknown"
062     END
063  
064     CRT MY.LINE:PIB "R#4":" ":PID "R#6":" ":TTY "R#7":" ":IP.FROM "L#15":" "
    :UDATE "R#5":" ":UTIME "R#5":" ":ACCOUNT "L#10"
065   END
066  
067 NEXT LINE.IDX
068
069 CRT
070 CRT
071
072 END

--
Pete Jewell
Example Systems Ltd.
--------------------
The views expressed in this email may not be those
of Example Systems Ltd unless explicitly stated.

 
 
 

1. Writing D3 AIX using OSFI to D3 NT problem

I need to write to a D3 NT file using OSFI within D3 AIX.  I can use the
COPY verb just fine.  Quite often when I use the WRITE verb, I get the
message:

Write/Delete (ITEM ID) Remote Operation Failed

O=Logoff / Q=Quit / R=Retry / C=Continue ?

ITEM ID being the item id I'm trying to write at the time.

You just have to Quit out of it.  Can anyone give advice on how to solve
this problem?

I'm running D3 NT v.7.1.4 , D3 AIX v.7.1.0.RS
I open the file like this:
OPEN "NT_SERV:TPS.DATA,MV_EMAIL," TO FILE.FAX ELSE STOP 201, 'MV_EMAIL'

NT_SERV = the name of my D3 NT Server
TPS.DATA = the account the file resides in
MV_EMAIL = the file name   (this was created in FSI)

2. PC Suddenly gone slow?????

3. Login Errors - D3 - AIX

4. Problems Configuring SQL Mail and Exchange

5. Moving data from D3 AIX to D3 NT

6. Update from Clearwater Beach

7. D3/AIX Account Restore from D3/NT

8. SQL 7.0 -> MSAccess via Internet?

9. ACCOUNT-RESTORE from D3/NT to D3/AIX

10. D3/NT Verses D3/AIX

11. D3 Install Aix D3 7.1

12. webdb aix login problems

13. Overflow problem - D3/AIX 7.1 on RS6000