Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get a unique line or port number returned from SCO Unix? 2

Status
Not open for further replies.

parrs

Programmer
Jun 27, 2002
2
GB
Hi anyone,

We are running SCO Unix with a Chase IO Lan Termserver.

I need to consistently return the same unique line number for each of the users.
Eg.
Two users log on to system with the same login on different terminals.
user1 logs on to terminal 1 - need unique line number (No 1)
user1 logs on to terminal 2 - need unique line number (No 2)
Both log off system.
Next day:
User1 logs on to terminal 1 - need to return the same unique line number as was used yesterday. (No 1)

The port number appears to be unique as we require but how do we get unix to return the port number?
Even if we can return the port number I don't know if this is the answer!

Thanks for reading it anyway.

Brian.
 
I don't know that you actually can do that. If your telnet'ing over to the server, it is just going to return what port you on as you login, for example (command: w):

User: TTY: login: idle: JCPU: PCPU: what:
user1 console 10:17am 4 2 2 -sh
user1 pts001 12:04pm 2 3 4 -sh
user2 pts002 13:01pm -sh
user1 pts003 14:34pm -sh

What exactly are you trying to find out? If you want to know where each login was at, you can run "command: last" and this will tell you.
 
I am not certain why Brian needs this info but I posted something somewhat similar some time ago and got no response. We have applications which relate the port tty id to a screen attribute table entry (Thoroughbred apoplications). Our requirement is that if you have say 64 telnet logins randomly logging in/out they only use say ttyp0 - ttyp63. This occurs when using os5.0.5 but not with uw7.1 and not always with os5.0.6. Thus in the 'w' list above if user1/pts003 logs out and anyone then logs in the port id will be pts003 for os5.0.5 but pts004... for the others.

Roy

 
As a work aroundfor many applications, you could specify an environment variable for each user whom logs in i.e. Tom is set to User=001, Jane is set to User=002 based on their own unique .profile and trying passing the variable to the software via a script. That generally tends to be the solution for many of the UNIX-based applications since the telnet login ttys are dynamically assigned.
 
Thanx for those replies ..
Within our application we will insist users logon only once and we will use the system uniquely generated User Id/Name.
Thanx 4ur help....
Brian.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top