Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 07-06-2006, 04:50 AM   #16
Registered: May 2001
Posts: 29,409
Blog Entries: 55

Rep: Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582

i want to give one user who is trusted to me this shutdown option for that i dont want to give our root user to him.
This can be done with Sudo:
- type "visudo" to edit /etc/sudoers,
- If not there add a line for your localhost: "Host_Alias LOCAL=localhostname" near the top of the file. "localhostname" is output from "hostname -s",
- Add the user if not already there: "User_Alias LUSER1=localusername". localusername is his local accountname,
- Add the command to shut down: "Cmnd_Alias SHUTDOWN=/sbin/shutdown -h now". Choose any arguments, but don't make the last one a wildcard unless you want him/her to type "shutdown -h now + 1 year" ;-p. If you need to allow him/her to add arguments but within a strict range and you don't want to use a regex and your scripting skills are OK, then you can replace the "/sbin/shutdown -h now" line with a wrapper script.
- Link command to user: "LUSER1 LOCAL=SHUTDOWN". He/she can now type "sudo /sbin/shutdown -h now" to bring down the box. You can also make an alias in his/her shell resource to make it easier:
alias sudo_shut="/location/of/sudo /sbin/shutdown -h now". This way he/she can type "sudo_shut" when logged in.

* If you fail making this work, or you don't understand this post your edited /etc/sudoers file.

To stop the Service squid after the 6:00 for our official restrictions.
This can be done manually with Sudo as well as a automated with a cronjob. To have squid stop automagically each day of the week at 18:00, add the next line to /etc/crontab: "00 18 * * */1 root /sbin/service squid stop".
Old 07-06-2006, 11:54 PM   #17
Registered: Oct 2005
Posts: 116

Original Poster
Rep: Reputation: 15

thank u

atlast i received the correct information. It helped me very much to setup the my server for trusted members only.

also squid crontab helped me even when iam not there.

really thank u very much to all for giving this wonderful solutions.


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
Can't long into linux as a normal user, help! m0rt3r Linux - Software 13 07-06-2006 09:23 AM
User admin and N/w admin on Gnome hangs ssrini *BSD 2 07-28-2005 07:55 AM
administrator not able to change permission cchanana Linux - Newbie 5 12-02-2004 11:04 AM
Letting normal user change apache directory nivek7 Linux - General 9 05-04-2004 06:58 PM
User admin. How to change a user... Pug405 Linux - General 3 04-09-2004 01:33 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:34 AM.

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