Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Matching Defaults entries for adm-gsousa on host02:
!env_reset, !requiretty, !visiblepw, always_set_home
User adm-gsousa may run the following commands on host02:
(ALL) NOPASSWD: ALL, !/usr/bin/passwd root, !/bin/* /etc/sudoers*, !/bin/* * /etc/sudoers.d/*, !/usr/sbin/visudo, !/bin/su, !/sbin/runuser, !/bin/sh, !/bin/bash, !/bin/tcsh, !/bin/csh
It does not work like that. You've already found the reason why blacklisting programs cannot work.
sudo works when you make a list of the few things you wish to allow an account to do as another user, usually root. Please check any of the three links above in that regard or refer to "man sudoers"
Which specific activities do you wish to allow the account "adm-gsousa" to do?
It does not work like that. You've already found the reason why blacklisting programs cannot work.
sudo works when you make a list of the few things you wish to allow an account to do as another user, usually root. Please check any of the three links above in that regard or refer to "man sudoers"
Which specific activities do you wish to allow the account "adm-gsousa" to do?
Ok. Then list them program by program inside /etc/sudoers for that user. That's how sudo works.
For editors use sudoedit instead of launching an editor directly with sudo. Be sure to preface pagers (less, more, and so on) with NOEXEC to reduce the likelihood of shell escapes.
You misunderstand, it looks like. No commands or patterns for commands may be preceeded with a negation. None. Please review any of the three links provided above. You've already pointed out how to work around negations. Negations don't and can't work for commands.
For example,
Code:
cp /bin/sh ./foo
sudo foo
Don't list the programs you don't want them to run. List the programs you do want them to run: Make a list of the programs which the account is allowed to use and put that list in sudoers.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.