1836412 Members
2281 Online
110100 Solutions
New Discussion

telnet hpux

 
SOLVED
Go to solution
Solution

Re: telnet hpux

take ownership of user profile as root and only read permission to the user.

in .profile write the line

kill -9 `who -u|grep jean |awk '{print $7}'


it will kill the user whenever he tries to login by telnet.

All the best.
kacou
Regular Advisor

Re: telnet hpux

ok!
That works well! but there is a mistake. see below:

/etc/profile[131]: Syntax error: ``' is not matched


Torsten.
Acclaimed Contributor

Re: telnet hpux

it is just before "who" - the second is missing.

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!   
kacou
Regular Advisor

Re: telnet hpux

torten
i don't catch you!!

what can i do to resolve the mistake
Torsten.
Acclaimed Contributor

Re: telnet hpux

This is the way how this works:

# command1 `command2`

e.g.

# echo "I am `whoami`"
I am root

The shell will execute the "whoami" first (result is root) and will pass this result to echo command.

In your case the ` is missing at the end of the line.

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!   
Robert-Jan Goossens
Honored Contributor

Re: telnet hpux

eg

kill -9 `who -u|grep jean |awk '{print $7}'`
kacou
Regular Advisor

Re: telnet hpux

1- there is always a mistake. see below:

/etc/profile[131]: Syntax error: ``' is not matched

2- l locked jean acount using passwd -l jean
i want to unlock it

please help for the two cases
Torsten.
Acclaimed Contributor

Re: telnet hpux

1) Be carefull, compare the above example with your line character by character - you need 2 times the -> ` <-

2) as root do

# passwd jean

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!   
Dennis Handly
Acclaimed Contributor

Re: telnet hpux

A more safe version of the command would be to not use obsolete `` but use $():
kill -9 $(who -u | grep -w jean |awk '{print $7}')

And to use grep -w so you don't kill jeanny.