![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Disable and Enable Backspace or Ctrl^H in vi | mobile01 | UNIX for Advanced & Expert Users | 5 | 11-24-2006 07:55 AM |
| terminating script with CTRL+D | sanchopansa | Shell Programming and Scripting | 12 | 10-26-2006 01:22 AM |
| Catching ctrl-C or ctrl-D | sendhilmani123 | Shell Programming and Scripting | 2 | 05-02-2006 02:02 PM |
| How to secure my script from Ctrl-C | jhansrod | Shell Programming and Scripting | 12 | 05-17-2005 08:38 AM |
| Script ctrl+c | newtounix | UNIX for Dummies Questions & Answers | 1 | 03-19-2001 01:23 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Disable ctrl-c,ctrl-d,ctrl-d in ksh script
I wrote a ksh script for Helpdesk. I need to know how to disable ctrl-c,ctrl-z,ctrl-d..... so that helpdesk would not be able to get to system prompt
|
| Forum Sponsor | ||
|
|
|
|||
|
I think Perderabo has already given you the best solution possible (make the script the login shell). You could also "trap" some signals (signal 1 is <CTRL>-<C>, for instance, "man ksh" and search for "trap"), but Perderabos way is still better and more general.
bakunin |
|
|||
|
The reason why you don't get the desired result is you aren't carrying out Perderabos advice: "~/.profile" is a script which is run at some point during shell startup. This means that your Helpdesk user has still "/bin/sh" or something such configured as login shell in /etc/passwd. Having a shell execute a script at startup is not the same as having this scipt as shell.
Instead of renaming your script to ".profile" you should change the entry in /etc/passwd for the users login shell from (presumably) "/bin/ksh" to "/this/users/home/script.sh", and rename the script back to "script.sh". Don't forget to add this to the list of allowed login programs in /etc/security/login.cfg if you are on an AIX box and probably to something analogous if you are on another system. bakunin |
| Thread Tools | |
| Display Modes | |
|
|