Linux users that can only perform predefined tasks
One of my clients want to create a user in his server that can only perform certain tasks, idiot proof, using a menu written in bash. I have to make sure that:
1.) When the user logs in, the menu will be shown immediately
- This is easy, I'll just launch the menu script in .bash_profile or .bash_rc
2.) The user must not be able to terminate the script without logging out.
- This took me a while to figure out. But eventually, I found out that I can do this by changing the interrupt and the suspend key. This can be done by calling `stty intr ""` and `stty susp ""` respectively in the script.
1.) When the user logs in, the menu will be shown immediately
- This is easy, I'll just launch the menu script in .bash_profile or .bash_rc
2.) The user must not be able to terminate the script without logging out.
- This took me a while to figure out. But eventually, I found out that I can do this by changing the interrupt and the suspend key. This can be done by calling `stty intr ""` and `stty susp ""` respectively in the script.