The shell script

This topic covers the steps required to replace a login shell with a customized script.

The shell script accepts the information on the command line and parses it, assigning values as needed to start the application. The application name is matched in a case statement, preventing direct execution of what the user sends.

The script provided later in this section is intended to be an example, and we expect you to tailor it according to your needs. Save it in a location where it can be executed but not changed by your users. Edit the /etc/passwd file to make a user call the script instead of a shell. Here is an example of the user "user1" running the script named "gdcstart".
user1:x:569:569::/home/user1:/home/user1/gdcstart

The script LOGIN_SCRIPT is designed to recognize the difference between being started from sshd or from telnetd. You could modify it to handle either condition differently. For example, you may want it to start an application in text mode when accessed via telnet, or in GUI mode when accessed via ssh.