Disable exit
hi guys
I'm working in a simple script which simulates th shell basically my customer wants a menu in linux which will be the only access for operators.... and they don't want them to have direct shell access so below is the best I could do... now I am having problems to handle the exit command since I only want end as my exit command is there a way to do that? using if or something? Code:
#!/bin/bash thanks a lot |
So... Do they want the users to only have access to a "kiosk" style system, or do you need a simulated shell environment? I was a tad confused after reading your post. :)
If you just want a kiosk, I think there have been several discussions here on setting one up. The search function may be of help. HTH Dave |
Quote:
|
sorry typed on the wrong thread
|
it fixed guys
I used exec script_name to load the script so when user type exit...the menu will log out the linux session :) now guys as I said that code above is a simulated linux shell very basic.... is there a way to improve it? commands like these ones won't work Code:
/sbin/ifconfig -a | less any idea how to improve this simulated command line? thanks a lot |
no problem guys
Code:
eval $whichcmd |
I am wondering, would it work better to put your users into a "restricted" group, then change the permissions on the commands you don't want them to run to not include execute permissions for that "restricted" group?
I'm just trying to advance from an alternate direction. :) HTH Dave |
Quote:
how can I achieve that? restricted groups? |
Basically, you create a group, name it whatever you like (you could use "restricted" if you wanted to), depending on which distro you are using, the steps may vary a little. You then change the permissions on the programs you want to run (exit, apt-get, aptitude, yum, etc) to exclude this new group.
Now anyone you add to this group will be unable to run the commands you have "turned off" This is the 30,000 ft view of groups, your google-fu will serve you well digging into the particulars. HTH Dave |
All times are GMT -5. The time now is 07:47 PM. |