LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 07-09-2006, 11:08 AM   #1
Braynid
Member
 
Registered: May 2006
Location: Romania
Distribution: CentOS
Posts: 140

Rep: Reputation: 15
How to set restrictions


Hello,
So i have the need to restrict the commands some users have on my Ubuntu server RC 6.06.
Lets say i just want them to use two scripts 'etrace' and 'eping'. No 'cd' no 'ls' nothing. I thought of using 'chmod' on directories in /bin. Can you please give me any suggestions?

Thanks.
 
Old 07-09-2006, 02:13 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Write a captive script or program that launches at login time (ie. put it in /etc/password/ per user). There are many ways of actually writing the script, ranging from a simple bash script (difficult to make bullet proof) to a full GUI written in a compiled language such as C.

--- rod.
 
Old 07-09-2006, 03:00 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
There's also ways of restricting the shell itself (restricted bash, though it works with other shells too). The bash man pages or Google can tell you exactly how...
 
Old 07-09-2006, 03:02 PM   #4
Braynid
Member
 
Registered: May 2006
Location: Romania
Distribution: CentOS
Posts: 140

Original Poster
Rep: Reputation: 15
The intention it's not to make bullet proof. All i want it's to prevent the regular users form accesing any command and those who know what they do to be delayed so that i can notice what they're up to. Any suggestions on actualy how to write the script?
 
Old 07-09-2006, 04:01 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
How about this, for a start?
Code:
#! /bin/bash

while [ 1 ]
do

        echo "Enter '1' or '2'"
        echo 1. Program 1
        echo 2. Program 2

        read prognum

        case $prognum in

                1) echo launching Program 1
                ;;

                2) echo Launching program 2
                ;;

                *) exit
                ;;
        esac

done
You need to flesh it out with your actual program names, more informative menu, etc. Make it executable, and name it in /etc/password as the 'shell' for appropriate users. Test it by executing from an ordinalry bash shell.

--- rod.

Last edited by theNbomr; 07-09-2006 at 04:03 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make restrictions? codeb Programming 13 04-19-2006 05:52 AM
Samba IP Restrictions gigglesnorter Linux - Networking 1 07-01-2004 04:52 AM
Restrictions X3781 Linux - General 1 01-07-2003 01:55 PM
command restrictions keevitaja Linux - Newbie 4 09-12-2002 06:40 PM
user Restrictions jpc82 Linux - Security 1 02-04-2002 02:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration