LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-04-2012, 04:32 AM   #1
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Rep: Reputation: 34
How to block sudo -i in sudoers file


Hi,

How to block sudo -i in sudoers file ?
 
Old 04-04-2012, 09:24 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Something like "user-spec host-spec = command_spec, !/usr/bin/sudo *-i*"?
 
Old 04-04-2012, 11:36 PM   #3
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Original Poster
Rep: Reputation: 34
I tried as user ALL=(ALL), !/usr/bin/sudo *-i* but its not working.Can you suggest any other solution ?
 
Old 04-06-2012, 04:11 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Quote:
Originally Posted by smilemukul View Post
I tried as user ALL=(ALL), !/usr/bin/sudo *-i* but its not working.Can you suggest any other solution ?
Please post actual output of the unprivileged user running 'sudo -l' and 'sudo -i' but do obfuscate individual entries like ", /xxx/xxx --xxx, /xxx/xxx --xx-x, " so we can have a good view of what's listed.
 
Old 04-08-2012, 08:51 AM   #5
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Original Poster
Rep: Reputation: 34
Actually " sudo -i " needs to be block for the users where they have sudo access but need to block sudo -i so that users can only access certain task through sudo with only their username as " sudo - <username " & not through "sudo -i" as there are many options to login through sudo.
 
  


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
Limit sudo to only one directory and it's subdirectories by sudoers file lcwilson Linux - Security 2 03-28-2012 04:55 PM
LXer: sudo install, usage and sudoers config file basics LXer Syndicated Linux News 0 08-29-2010 01:30 PM
[SOLVED] Can't Execute Commands as sudo Nor Access Sudoers File in Mandriva 2010.1 gdawg Linux - Newbie 4 08-17-2010 02:32 PM
LXer: Quick how-to sudoers file (sudo command) LXer Syndicated Linux News 0 11-25-2007 02:50 AM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 06:03 PM


All times are GMT -5. The time now is 10:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration