LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-02-2009, 03:22 AM   #1
camry
LQ Newbie
 
Registered: May 2008
Posts: 27

Rep: Reputation: 15
Preventing users from excute commands


Dear All
I have RHEL5 box, I want to prevent all users from excuting a specific command "history -c" or history command in general, How can I do ?

Thanks
 
Old 06-02-2009, 04:00 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
History is an internal command, so I don't think you can do it directly. You could put a dummy alias in each user's .bashrc though to execute some useless command.
 
Old 06-02-2009, 05:36 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Functions supersede aliases and are searched for before builtins. Setting the alias in the users shell resources enables users to muck with it so better use system-wide /etc/profile.d/. The question remains though what the reason is for requiring this anyway. If this is about preserving history I'd point to 'rootsh' (again).
 
Old 06-03-2009, 11:38 AM   #4
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by unSpawn View Post
Functions supersede aliases and are searched for before builtins. Setting the alias in the users shell resources enables users to muck with it so better use system-wide /etc/profile.d/. The question remains though what the reason is for requiring this anyway. If this is about preserving history I'd point to 'rootsh' (again).
Any alias to command 'command' easily bypassed by user with
Code:
\command
But I failed to see what's a point of disabling history.
 
Old 06-03-2009, 12:21 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Both aliases and functions can be unset or bypassed. I kind of wondered the same and that's why I already asked "the question remains though what the reason is for requiring this anyway".
 
  


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
hw to excute command_string in sprintf mallikk_in Linux - Software 1 09-03-2007 10:57 AM
Preventing new users from posting links vharishankar LQ Suggestions & Feedback 8 09-16-2006 01:21 AM
Preventing local users from "text flooding" a terminal (DoS attack)... khermans Linux - Security 2 09-24-2003 08:56 AM
Preventing users to bind server to ports 0-10000 Kostko Linux - Networking 0 08-27-2003 05:58 AM
preventing users to make outgoing connections Shroom Linux - Security 5 06-15-2003 06:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:55 AM.

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