Operating System - HP-UX
1752522 Members
5149 Online
108788 Solutions
New Discussion юеВ

Re: How to restrict a user ID access to only 8am to 5pm

 
SOLVED
Go to solution
Jerry_109
Super Advisor

How to restrict a user ID access to only 8am to 5pm

HP-UX B.11.11 U 9000/800/rp7410
#############################

Hello All,

Question :

I need to restrict a "user id" to a certain logical colume & only have access from 8am to 5pm M-F.

Is this passible ?
6 REPLIES 6
Oviwan
Honored Contributor
Solution

Re: How to restrict a user ID access to only 8am to 5pm

you could write a script and insert this to the .profile of the user:

if date >= 8am and date<=5pm
then logout

regards
Deepak Kr
Respected Contributor

Re: How to restrict a user ID access to only 8am to 5pm

Two ways you can do it:

Method 1:
Go to SAM->Accounts for Users and Groups -> Users
select the user u wish to restrict
select action->Set Authorized Login Times...
and select the login time for that user.
In your query it is 8am to 5pm Monday-Friday

Method 2:

Using command line:

/usr/lbin/modprpw -m timeod=Wk0800-1700 username

Cheers!!
Deepak
"There is always some scope for improvement"
Dennis Handly
Acclaimed Contributor

Re: How to restrict a user ID access to only 8am to 5pm

>certain logical colume

What's this? (Assuming it is column?)

>Deepak: Go to SAM->Accounts for Users and Groups -> Users
/usr/lbin/modprpw

Both of these requires a trusted system.

>Oviwan: insert this to the .profile of the user:

This would probably have to be added to /etc/profile if the user can modify his .profile.

>if date >= 8am and date<=5pm
then logout

hour=$(date +%H)
day=$(date +%u) # Mon == 1
if (( hour < 8 || hour >= 17 || day > 5 )); then
exit
fi
Jerry_109
Super Advisor

Re: How to restrict a user ID access to only 8am to 5pm

Sorry all,

not "logical colume"
it's "logical volume"
Dennis Handly
Acclaimed Contributor

Re: How to restrict a user ID access to only 8am to 5pm

>it's "logical volume"

What did you have in mind about restricting to a given logical volume? Where his files are placed?
I'm not sure even ACLs will help here??
Deepak Kr
Respected Contributor

Re: How to restrict a user ID access to only 8am to 5pm

Yeah,

To restrict users to file system level then ACL implementation is better idea.

e.g.
setacl -m user:user_name:permissions(rwx) Path

"There is always some scope for improvement"