LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-28-2006, 10:24 AM   #1
bardinjw
Member
 
Registered: Apr 2003
Location: boston
Distribution: ubuntu debian redhat fedora
Posts: 108

Rep: Reputation: 15
restrict sudoers by envirnmoent


Can someone think of a way to do this with sudoers?

I want sudo to not ask for a password (easy), but only if I'm connected via ssh (not so easy).

Is there someway to check for an environment variable? I could use the existence of SSH_CONNECTION to verify it, and even better, restrict this behavior to when I'm connecting from a specified subnet.
 
Old 07-30-2006, 04:22 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
i would expect that whatever you want to achieve could be handled via the standard format of the sudoers file. you can easily define arbitrary ip sourcs and netblocks to control this. insofar as comparing ssh to other access forms, i wuld suggest that the only remote access to a shell you have is ssh anyway? inwhich case it is reduced to just a network based connection. check the sudoers manpage for details of defining network objects.
 
  


Reply

Tags
sudoers


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
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
Regarding SUDOERS hinetvenkat Linux - Networking 1 09-02-2005 02:47 PM
sudoers usa1234 Linux - General 1 10-24-2004 04:07 PM
Sudoers Fonke0412 Linux - Newbie 3 08-10-2003 04:54 PM
sudoers........ help linuxlah Linux - General 4 01-15-2003 12:54 AM


All times are GMT -5. The time now is 02:42 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration