Linux – How to lock user in a shell script program

linuxpromptshellshell-scripting

Let's say I have a Linux OS without desktop environment. After the PC finish boot up, it will directly show the shell terminal to the user.

I plan to write a shell script program and make it automatically start everytime after the PC finish boot up, so that, instead of seeing a normal shell prompt, the user will see my shell script program after the PC finish boot up.

In the shell script program, i will give the user a list of options to configure something in my PC. And I want the shell script program to run continuously in this PC.

I would like to lock the user in the shell script program so that they cannot escape to the normal shell prompt and access the file system. Only administrator with root password can escape to the normal shell prompt and make changes to the PC.

Can anyone give me some advices how can I do this?

Thanks.

Best Answer

Make your autologin user's login shell be rbash, and make the script the only thing they can run. Even if they escape the script, they won't be able to do anything except log out or start the script again.