Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Editing Sudoers, what are the options?

    Hi,

    I am confused about editing Sudoers file as what to write and what not to? Can you please help me?

    I am trying to edit Sudoers for running few commands like copying, moving, listing, searching, creating, changing permissions on files and directories in the home directory for user e.g. a test user but i am not sure how to restrict the user action to a particular directory or restrict the commands all other commands except ls, cp, grep, wc, cat, touch, chmod, chown running at root level (e.g. rm -r command)? What would be the syntax?

    Thank you in advance.

    Shahmeer




  2. #2
    Join Date
    Aug 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi,

    a normal user only can damaged his own files in his own home directory but if you want to permit him to execute commands like a root (dangerous thing) you should edit sudoers.

    Example: permit a user test to rebbot the server:

    edit /etc/sudoers with visudo

    #visudo

    add the line:

    test ALL = NOPASSWD: /sbin/reboot


    test> sudo reboot

    Remenber to use complete path to the comands (#which reboot) in /etc/sudoers.


    Regards.

  3. #3
    Join Date
    Sep 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Shahmeer if you let the user run chmod then they can make everything belong to them. Then they can quite happily rm -r as their own user.

    Also chmod -R / 755 is plenty destructive to the system in itself. If you don't trust them don't allow them to execute above user level.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 03-26-2012, 08:33 AM
  2. Replies: 0
    Last Post: 01-17-2012, 09:28 AM
  3. Replies: 0
    Last Post: 12-22-2011, 08:36 AM
  4. Replies: 0
    Last Post: 12-03-2011, 07:22 PM
  5. Replies: 0
    Last Post: 11-04-2011, 12:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
           








Check out Linux Central for Linux software and other goodies!





» Stats

Members: 3,586
Threads: 3,921
Posts: 9,448
Top Poster: Fred (1,486)
Welcome to our newest member, mortizglez

» Links



Powered by vBadvanced CMPS