1837887 Members
4635 Online
110122 Solutions
New Discussion

Re: csh login trap

 

csh login trap

I am installing Control M on an HP server running HPUX 11.00. One of the tasks I need to do is to stop the control m users (ctmserv and ctmagt) from logging on direct to the server.

C shell is foreign to me. The option (other suggestions are welcome) I am looking at is to modify their profile by including a trap.

Are there any C Shell "gurus" out there that can assist ???

6 REPLIES 6
Scott Van Kalken
Esteemed Contributor

Re: csh login trap

there is a global profile for C shell

it's /etc/csh.profile

you could just do the old:

who=$(id -un)
case $who in
ctmagent) exit 1;
;;
*) ;;
esac


and so on for each user you don't want to log in.

The other alternative is to disable the accounts, this will not stop someone from su-ing to them.

Scott.
Steven Sim Kok Leong
Honored Contributor

Re: csh login trap

Hi,

The global profile for csh is /etc/csh.login.

Hope this helps. Regards.

Steven Sim Kok Leong

Re: csh login trap

Scott, the file is actually csh.login.

Do you know the csh trap commands stop the user
from breaking out ???
Steven Sim Kok Leong
Honored Contributor

Re: csh login trap

Hi,

The trap commands for csh are the same as that for sh.

trap "" 1 2 3
# insert commands you do not wish the user to break out from here
trap 1 2 3

Hope this helps. Regards.

Steven Sim Kok Leong
Scott Van Kalken
Esteemed Contributor

Re: csh login trap

oops

yup it's csh.login

been operating posixly correct for too long :)
Patrick Wallek
Honored Contributor

Re: csh login trap

If you wish to keep the ctm users from logging in just change the password field in /etc/passwd for thectmserv and ctmagt users to be a *.

This will prevent the users from logging directly into the server, but if you are root you can still do a 'su - ctmserv' or 'su - ctmagt'.