Ec2 login prompt script

Hey guys, trying to create a script that will run in the background until a user logs in and then present them with different options to proceed further.
It is on an Ubuntu 10.04 Amazon ec2 system.
The system runs 24/7 as it is and just needs to feed the prompt to whoever logs in.
Is this possible using just bash and native unix functions?

You can designate any executable as login shell for a user. Create a script presenting and executing these functions you talked about, then put it in "/etc/passwd" as login shell for this user. It will be started when the user logs in and whe he leaves the script he will be automatically logged out.

I hope this helps.

bakunin

1 Like

The custom login shell in /etc/passwd suits for a kiosk system where the user may not break out to the shell prompt.
For an initial script ending in a shell prompt /etc/profile is the right place. Most Linux distros have code there that run scripts in /etc/profile.d/ - you can simply add your script there.

1 Like

Lifesavers, cheers guys.