I am working on migrating an application from OpenVMS to RedHat Linux 6. The application is a green screen terminal application. The users will log into Linux via SSH and the application should automatically start but they should never have access to the shell. Once the application closes or crashes it should automatically log them out. What is the best way to approach this?
I've tried creating a new user with the following command.
useradd -s /sbin/nologin test
I then added ftp & to the users .bash_profile in the hope it would open the ftp console immediately and then once they quit it would log them out. However upon authentication on SSH the session is killed. Any ideas?
Best Answer
The "green screen" application I've supported for the past 12 years accomplishes this via a modified
.bash_profile
and a wrapper script to start the application.After the systems are built and service users created, we modify the default
.bash_profile
in the/etc/skel
directory. This ensures that new users created on the system pick up the login settings.Let's call the application "peach"
Inside the .bash_profile,
The actual "run-peach" wrapper script will look like:
The
set -e
andtrap
are important here.