LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-13-2012, 08:37 AM   #1
roni_atx
LQ Newbie
 
Registered: Jul 2008
Posts: 10

Rep: Reputation: 0
Special Permission for normal users


Hi Friends,

I am new in this forum. In my VM I have installed Redhat6 . It looks pretty good. I am facing a small problem. Hope with your help I can troubleshoot. I have created normal user as "test". Then I login to "test" user and was trying to execute shutdown/poweroff command. Normally it won't allow to user to do that. So I wanted to give special permission to "test" user where I could execute "shutdown/poweroff" command. kindly check the following syntax which I have executed in console mode.

chmod u+s /sbin/shutdown

I have executed above syntax from "root" account. Then i login to "test" account and was trying to execute "shutdown/poweroff" command. It said insufficient privilege after given special permission for all users. Could someone please suggest me how could I solve this problem?

Thanks a lot in advance !

Regards
Abhimanyu
 
Old 07-13-2012, 09:19 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It is generally NOT a good idea to change owner, group, permissions on system binaries. First off tools that check whether you've been hacked look for this, second many such tools are written so they won't work unless they have the expected settings and lastly any update to packages you do will likely change permissions back.

The best way to give non-root users access to root commands is with sudo. With sudo you setup a sudoers file to designate which users can run which commands. You can make it very broad (e.g. give all system administrators rights to do every command) or very specific (e.g. give a single user permission to execute a single command as root).

Be sure when giving users access to such commands that you understand exactly what you're giving them. For example you should NEVER give sudo access to vi,vim or many other editors because most of them allow access to the shell and the shell would be a root shell.

If you do a web search for "sudo tutorial" you'll find many. For example:
http://home.ubalt.edu/abento/linux/terminal/sudo.html
 
Old 07-13-2012, 02:07 PM   #3
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
With RH I believe you are better off with using /etc/pam than changing the permissions (I really hope you know what the permissions are).
If you want the user to shutdown then editing the inittab is the best way. Any user can push ctrl+alt+del and shut down the system.
As far as shutdown is concerened it is a binary and so this binary has some libraries to make it run. If you want shutdown to be done by users then you would have chmod all the relevant libraries too. This is what I think - I may be wrong.
 
Old 07-13-2012, 02:50 PM   #4
roni_atx
LQ Newbie
 
Registered: Jul 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Hi Friends,

Many thanks for the valuable suggestion. Actually I am learning Linux. Just wanted to know that how I could execute the system command from normal user mode by using chmod command.

Regards
Abhimanyu
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help for special permission bits lqchangba Linux - Security 2 02-20-2007 12:36 PM
"Permission Denied" for normal users on physical console brycebent Linux - Security 5 07-14-2005 11:42 PM
Access permission bits for special files spinifeX Linux - General 1 01-08-2005 02:05 PM
Permission for normal users Vizy Linux - General 1 03-16-2004 11:39 AM
permission for normal users to read my NTFS HDs. Moebius Linux - Newbie 6 01-26-2004 06:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:10 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