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

Posted on 2009-04-17
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
Question by:Waschman
    LVL 14

    Expert Comment

    To change Gnome lockdown settings, you can install Pessulus:

    sudo apt-get install pessulus
    LVL 2

    Author Comment

    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???
    LVL 2

    Author Comment

    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.

    LVL 2

    Author Comment

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

    Accepted Solution

    you may add the the following to /etc/profile

    /usr/bin/groups | /usr/bin/grep -w students
    if [ $? -eq 0 ]

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

    Author Closing Comment

    Thank you very much. It helped alot.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
    You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now