The main point is that I only want one user to have sudo access - really only for use in set up and emergencies. I don't even trust myself with sudo access all the time. Are there best practices around doing that? Examples:
Give a user/group access to a particular port (and not others) without giving sudo access (some answers are net_bind, iptables, and authbind) Install services like apache in a way where users can use it without sudo Install systems like node.js in a way that allows Give a user or group broad permissions to install programs that other users can use, again without giving them sudo or root access If I want to give someone as broad permissions as possible without them having any permissions to do anything that will clobber the machine (clobber sudoers, clobber /etc/passwd [which literally just happened to me], clobber anything that would prevent logging in via ssh on root, etc), how would I do it?
The main point is that I only want one user to have sudo access - really only for use in set up and emergencies. I don't even trust myself with sudo access all the time. Are there best practices around doing that?
sudo
, and makesyslogd
sendsudo
logs to a remote host. Tell the guy about the logs, too. And think ofsudo
as an audit mechanism, rather than a security one. This is better than your solution for two reasons: first, as @Anthon points out, being able to install things == root, and second, a solution that can fail in 200 interesting ways is a bad solution, regardless of how clever it might look in theory. – lcd047 May 31 '15 at 11:42sudo
is just a package - you can uninstall it. It is not necessary - and, in many cases, it's more than a little dangerous. The primary benefitsudo
offers is that it allows lazy admins to to avoid properly configuring hierarchical group-based permissions, and that said admins can do so without having to share a password. So just uninstall it, and go out and learn how to setup a system with a real root account properly - particularly look at such thingschgrp
(which is useful for interactive shells to lower/higher permissions as needed) and group perms in general. – mikeserv May 31 '15 at 15:58chgrp
. By the way though,ksh93
can be built to handle profile shells which can enable you to switch E[GU]IDs mid-session safely - but you'd have to make its executable filesetuid
- just likesudo
in that case. – mikeserv May 31 '15 at 21:51