Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
while [ "$whichcmd" != end ]
do
read whichcmd?"Enter Command: "
$whichcmd
done
whichcmd=0
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.
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
simulated shell environment that's why the script above but I want something like when exit is typed say "Not allowed" and continue to promt again to type more commands
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.