Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I add a logon shell script for group in ubuntu?

Posted on 2009-04-17
6
Medium Priority
?
555 Views
Last Modified: 2013-11-15
Hi everyone!
I am running an Ubuntu LTSP server with clients already set up. I have configured some users and added them to a group named "students".

My problem is that I want to run a shellscript when a user in the specified group logon to the system. I want to run the script for the whole group and not only the individual user.

I want this because I'm trying to lockdown the client users, for example users in the student group are only allowed to access their own /home-directory (and no access to other students home directories), use Firefox, play some games, view videos with VLC and use OpenOffice for school work.

I have tried "thin client manager", "LTSPManager", "GConf", manual commands like "sudo chmod 744 /usr/games" but none of them can accomplish what I want to do.

Maybe there is a "Kiosk Admin Tool" for ubuntu Gnome instead that can do this?

Please can someone help me with this? I'd be very grateful!
Cheers, Waschman
0
Comment
Question by:Waschman
  • 4
6 Comments
 
LVL 14

Expert Comment

by:Fabio Marzocca
ID: 24166658
To change Gnome lockdown settings, you can install Pessulus:

sudo apt-get install pessulus
0
 
LVL 2

Author Comment

by:Waschman
ID: 24167034
Hi!
I have tested that application and it doesn't work as expected. Thanks anyway.

The main problem is to connect a shellscript to a group of users that run when they logon to the system (their thin client). How do I manage that?

I have thought of a manual solution like the following:
1. Read list of users from the system
2. Find the group for every user
3. Run specific shellscript that is bound to the group "students"
4. Add this control script to /etc/rc.local
5. Now when a user in group "students" logon to the system a specific shell script should be run???
0
 
LVL 2

Author Comment

by:Waschman
ID: 24172378
Forgot to mention: I am using Ubuntu 8.10

I am still trying to fix this but I don't have any ideas left!

The pessulus program does start and show up correctly but it doesn't really apply the settings. For example:

1. I ran pessulus with command: sudo pessulus
2. I checked the box for "Disable lock screen" and exited the program
3. I restarted the gnome panel with: sudo killall gnome-panel
4. I tried to logout and login again
5. I can still use the "lock screen" feature but it should be blocked.

Anyone?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Author Comment

by:Waschman
ID: 24350108
Is there anyone that knows Ubuntu and how to add a logon shell script for a group? Pessulus can't do what we want.
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 2000 total points
ID: 24351219
you may add the the following to /etc/profile

/usr/bin/groups | /usr/bin/grep -w students
if [ $? -eq 0 ]
then
      /path/to/script
fi

This will check if the user is in group students then run the script
0
 
LVL 2

Author Closing Comment

by:Waschman
ID: 31571406
Thank you very much. It helped alot.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month20 days, 17 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question