Operating System - HP-UX
1833756 Members
2586 Online
110063 Solutions
New Discussion

Re: Telnet - identifying port

 
SOLVED
Go to solution
Kenn Kantola
Advisor

Telnet - identifying port

If I telnet in to the hp system (11i) as any user except root I am unable to identify my tty designation. If I type a ps in isresponds with 'don't know which terminal to select'.
As root it works fine. Any idea what I have set wrong?
8 REPLIES 8
Jeffrey S. Sims
Trusted Contributor

Re: Telnet - identifying port

Well you could always state the terminal in your .login file that way it will be set whenever you login.

Such as adding:

export TERM=vt100

Kenn Kantola
Advisor

Re: Telnet - identifying port

Sorry, I didn't explain it well. I don't need the TERM. I need the pty. if I type in ps from root it tells you all the processes you are running. If I type it from a non root account, telnet'd in, it says it doesn't know which pty I am so it can't identify me or my processes. Our DB software uses this to set a DB user id. UNIX knows me, since if I do a ps -ef | grep on anything it will tell me what pty is doing the grep, but a simple ps doesn't work on nonroot telnet logins. Longwinded, but I hope that explains it better.
Sridhar Bhaskarla
Honored Contributor

Re: Telnet - identifying port

Kenn,

Did you try the command "tty" ? Is this what you were asking?

-Sridhar
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: Telnet - identifying port

Kenn,

I didn't read your message quite well. OK. My last message doesn't help you at all. Did you try logging as root at the same and see what pty the ordinary user is using on?. I feel it would some permissions problem not sure where. Could be /var/adm/ps_data?. what does 'tty' command return?

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Kenn Kantola
Advisor

Re: Telnet - identifying port

I looked at var/adm/ps_data. I changed the permissions to 666 but it didn't make a diffeence. The tty command from a user in telnet returns " not a tty". From root it returns /dev/pts/t4 for instance. So tty seems to have the same issue as ps. I tend to also think it is a permission somewhere. Thanks.
John Waller
Esteemed Contributor
Solution

Re: Telnet - identifying port

Could try checking to ensure directories /dev and /dev/pts are read and execute for everyone. Also check everyone can read /var/adm/ps_data. I don't expect it will be as simple as incorrect permissions on one of these but you never know.
Edward Alfert_2
Respected Contributor

Re: Telnet - identifying port

i may not be understanding this properly, but can't you just use the following?

$who am i
which for non-root users returns something like:
ealfert pts/tR Sep 5 08:41

and for root
#who am i
returns something like:
root pts/t9 Sep 4 10:52

then just grab the second column with the awk command?

"Do what you love and you will never work a day in your life." - Confucius
Kenn Kantola
Advisor

Re: Telnet - identifying port

John, Thanks. It was the permissions on one of those. I had changed them on pty but not pts. All is well.
Edward... I had to get the ps to work, as it is part of INformix/UniVerse. I can not change how they set the UID in the db so I had to get ps to work normal. Thanks anyway.