Re: How to restrict a user ID access to only 8am to 5pm (139 Views)
Reply
Super Advisor
Jerry_109
Posts: 389
Registered: ‎11-05-2004
Message 1 of 7 (139 Views)
Accepted Solution

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 ?
Honored Contributor
Oviwan
Posts: 692
Registered: ‎11-29-2005
Message 2 of 7 (139 Views)

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
Respected Contributor
Deepak Kr
Posts: 424
Registered: ‎07-11-2008
Message 3 of 7 (139 Views)

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"
Acclaimed Contributor
Dennis Handly
Posts: 25,058
Registered: ‎03-06-2006
Message 4 of 7 (139 Views)

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
Super Advisor
Jerry_109
Posts: 389
Registered: ‎11-05-2004
Message 5 of 7 (139 Views)

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

Sorry all,

not "logical colume"
it's "logical volume"
Acclaimed Contributor
Dennis Handly
Posts: 25,058
Registered: ‎03-06-2006
Message 6 of 7 (139 Views)

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??
Respected Contributor
Deepak Kr
Posts: 424
Registered: ‎07-11-2008
Message 7 of 7 (139 Views)

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"
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.