1834457 Members
2783 Online
110067 Solutions
New Discussion

Re: Login Terminal types

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Login Terminal types

Hi,

In the below output of who command, pts/1 and pts/2 indicates what type of terminals ? I mean users has logged in by which method to the box ?

sksonkar ttyp5 Jan 21 13:00
sksonkar ttyp6 Jan 22 09:45
user1 pts/1 Jun 12 08:53
user2 pts/2 Jun 19 10:15

Thanks,
shiv
8 REPLIES 8
Torsten.
Acclaimed Contributor

Re: Login Terminal types

So many parameters for who.

Try

who -T

and man who.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Steven E. Protter
Exalted Contributor
Solution

Re: Login Terminal types

Shalom Shiv,

pts/1 do designate psuedo terminals.

As the term implies its a really a terminal tarcking connection.

There is no relation to the termain type at all.

pts/1 can be vt100, vt220, hp TERM type, anything your system is set up to perform.

The ttyp devices are different and indicate a login via probably a mux or other serial device sharing scheme.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
inventsekar_1
Respected Contributor

Re: Login Terminal types

HI SHiv,
hope u find out pts from SEP's reply.
and little more:
who -R --->u can find out the ip address of the users.
simple command to give lot of info is the single letter "w".
Be Tomorrow, Today.
Bill Hassell
Honored Contributor

Re: Login Terminal types

Your listing above shows two very different methods of connecting to your computer. The ttyp# names are for serial ports, perhaps a modem or direct-connect terminal. The pts names refer to LAN or network connections. If you want to know the type of terminal (Wyse, VT100, Hyperterminal, HP terminal, etc), there is no way to determine this without asking each user to tell you what $TERM reports in their session.

If you must determine the terminal type automatically for each user, edit the file /etc/profile and add something like this:

MYTERM=$(ttytype -s)
echo "$LOGNAME $(date) $(tty) $MYTERM" >> /tmp/logins.history

This will tell you what each user has as a terminal.



Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: Login Terminal types

Actually, this is cleaner:

echo "$LOGNAME $(date) $(tty) $(ttytype)" >> /tmp/logins.history


Bill Hassell, sysadmin
inventsekar_1
Respected Contributor

Re: Login Terminal types

Bill, in my 11i system,
# ttytype -s
TERM='vt100'; export TERM;
LINES=24; export LINES;
COLUMNS=80; export COLUMNS;
ERASE='^?'; export ERASE;
root@hpspool1 [ / ] #

# tty
/dev/pts/ta

but

#set
TERM=xterm
TMOUT=0
TZ=IST-5:30

what is wrong?
Be Tomorrow, Today.
inventsekar_1
Respected Contributor

Re: Login Terminal types

any ideas guru's???
Be Tomorrow, Today.
Bill Hassell
Honored Contributor

Re: Login Terminal types

Sekar,

You wrote:

> # ttytype -s
> TERM='vt100'; export TERM;

This indicates that you are running a dumb terminal emulator.

> #set
> TERM=xterm
> TMOUT=0
> TZ=IST-5:30

This indicates that you did not login using telnet since there is virtually no environment. Your TERM variable is set to xterm which means you are borrorwing an emulator from HP-UX. And since xterm is an Xwindows program, you are either running an HP-UX graphics workstation or using a PC or Linux system to connect to your HP-UX system. This is a very different environment (due to the way Xwindows is normally configured) so your environment is severely truncated.

You need to use a 'normal' login where you get a login shell and a normal environment. If you must use Xwindows, then run this command:

echo "*loginShell: true" >> $HOME/.Xdefaults

on your HP-UX system. Then close your window and login again. This time, you will have a login shell and complete environment.


Bill Hassell, sysadmin