LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 10: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, 01:13 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
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, 02:00 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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, 02: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, 03:01 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
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 03:03 PM.
 
  


Reply



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 04:52 AM
Samba IP Restrictions gigglesnorter Linux - Networking 1 07-01-2004 03:52 AM
Restrictions X3781 Linux - General 1 01-07-2003 12:55 PM
command restrictions keevitaja Linux - Newbie 4 09-12-2002 05:40 PM
user Restrictions jpc82 Linux - Security 1 02-04-2002 01:35 AM

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

All times are GMT -5. The time now is 07:56 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
Open Source Consulting | Domain Registration