Operating System - HP-UX
1834022 Members
3084 Online
110063 Solutions
New Discussion

Disable "set home session" ability

 
SOLVED
Go to solution
Daniel Gowans
Advisor

Disable "set home session" ability


I have several users that use the same login, and work on different shifts. I don't like it that way, but it is beyond my power to change. At any rate, they have little "battles" amongst themselves where one sets up the CDE session one way and saves the home session, another changes it and does the same. Now they are complaining to me. Is there any way to make it impossible for the users to set their home session, making it read-only or something? That would be very nice.

Thanks!
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: Disable "set home session" ability

Obviously you'd be better off with three user id's.

But, you can do a few things.

You can modify the .profile to prompt the user for their real identity, or make an assumption based on time of day.

Whatever your methodology, you can moidfy the $HOME variable.

This becomes a little trickier based on CDE login, because I don't think you can prompt the user for any input. Usually this is controlled by different logins.

Again, you can check the time, and set the $HOME variable based on time of day so that the profiles are protected.

I'd say do an env > /tmp/env.text to get a handle on all the possible environment variables what will need to be checked.

Lastly, if they are logging in from different workstations you might be able to make script decitions based on the IP they login from.

who -u

root console Aug 10 01:15 old 1673 system console
root pts/0 Aug 21 17:31 . 12128 192.168.0.2
Thu Aug 21 22:31:11 2003:/root


Note the IP address of the second user.

That output can be accessed by punching it through awk as follows:
who -r | awk '{print $7}'

You will have to refine it to get it into an environment variable, but with the right tools you can accomplish your goal.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Daniel Gowans
Advisor

Re: Disable "set home session" ability



Thanks Steven, your replies are always quick and helpful. I like all of your suggestions, but this is a production environment so I think I want to just restrict their settings completely. The problem being that they all use the same machine (IP, etc) just at different times of day.

I am worried about the effects of this, but I just ended up making the directory ~/.dt/sessions and everything under it read only and owned by root. In addition, the session is set to always use the home session.

The effect is that when a user tries to press "Set Home Session" after making changes, the screen locks with the hourglass for about 5 minutes (I guess it is _trying_ to change files,) then starts working again. Upon logging in again, they find nothing has changed. At least they can't mess with the settings now.

Any better ideas? I am hoping in the future to get permission to give them all their own logins.
Steven E. Protter
Exalted Contributor

Re: Disable "set home session" ability

I would suggest a program that pops up after cde login and asks them who they are.

Then you can set environment settings accordingly.

Unfortunately, I have no idea how to implement it, not being a CDE maven.

Its an environment variables though. Nice solution though, even though it inconveniences the user that tries to save settings. Permissions are quite useful aren't they.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Michael Tully
Honored Contributor

Re: Disable "set home session" ability

I'm no expert in CDE either, but here's a couple of suggestions.

Have a look in $HOME/.dt/sessions
There is a directory there called home.
Change the permissions so that they are read only.

Further, have a look at the suggestions in this posting by Alex. (He is a guru in CDE)

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xcc0e06350fe2d61190050090279cd0f9,00.html
Anyone for a Mutiny ?
Daniel Gowans
Advisor

Re: Disable "set home session" ability


Thanks Steven and Mike. I think that I may try the sessionexit script. Since they work different shifts, one exits before the other comes. That script could copy the session settings over the home session each time they exit from another source, effectively resetting them upon each logout. Thanks for linking me to Alex's suggestions.