Operating System - HP-UX
1830978 Members
1964 Online
110018 Solutions
New Discussion

Re: Restrict login by run-level?

 
Lindsay Hill
Occasional Advisor

Restrict login by run-level?

Hi,

We run several custom run-levels here, and we are looking for a way to restrict login at run-level 3 to root, and a list of authorised users.

My first thought was to modify /etc/profile, to look at who is trying to login, what the run-level is, and are they allowed?

This works fine for logins via telnet or X, but it causes problems when logging in via CDE, as /etc/profile is not run.

I guess I could modify dtprofile, but I was hoping someone might know a better way of solving this problem.

Thanks,

Lindsay
2 REPLIES 2
Tom Danzig
Honored Contributor

Re: Restrict login by run-level?

You can force dt (CDE) to read the profile and include your restriction code there. A script that parses "who -r" output to check the current run level and restricts based on your list of allowed users. I don't recall the exact setting (something like DTSourceProfile=TRUE) or where it's located though. I avoid CDE as much as possible :)

Hope this info is of some value to you.
Madhu Sudhan_1
Respected Contributor

Re: Restrict login by run-level?

Hi Lindsay !
I have one more thought. If you can afford to work with /etc/passwd, you can have passwd.1, passwd.2, passwd.3 ... passwd.6 with the users of your choice in these files in a temporary, restricted location and have them copied to /etc/ as "passwd" file as and when the run level changes using the concept of startup and shutdown scripts which are to be located at /sbin/init.d, /sbin/rcN.d.

...Madhu
Think Positive