Linux Security Cookbook [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Linux Security Cookbook [Electronic resources] - نسخه متنی

Daniel J. Barrett, Robert G. Byrnes, Richard Silverman

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید










Recipe 5.9 Prohibiting Command Arguments with sudo



5.9.1 Problem


You
want to permit a command to be run via sudo, but
only without command-line arguments.


5.9.2 Solution


Follow the program name with the single argument " in /etc/sudoers:

/etc/sudoers:
smith ALL = (root) /usr/local/bin/mycommand "
smith$ sudo -u root mycommand a b c Rejected
smith$ sudo -u root mycommand Authorized


5.9.3 Discussion


If you specify no arguments to a command in
/etc/sudoers, then by default any arguments are
permitted.

/etc/sudoers:
smith ALL = (root) /usr/local/bin/mycommand
smith$ sudo -u root mycommand a b c Authorized

Use " to prevent any runtime arguments from being authorized.


5.9.4 See Also


sudo(8), sudoers(5).

/ 247