OK, so I haven't had time to do much lately (how does everybody else carve time out for hobbies?), but I did do some research and playing around. Starting with others' inputs above, here's what I've come up with. I also looked at what packages I could remove from the base install, and the users that would go with those.
Linux Standards Base Required Users/Groups
Code:
User Group Notes
-------- -------- ---------
bin bin Legacy user/group for system admin software
should not be used by new applications
daemon daemon Legacy user/group for daemons that don't have their own userid
should not be used by new applications
root root Administrative user
CentOS Required Users
Code:
User Group Notes
-------- -------- ---------
rpm rpm Package management
vcsa vcsa virtual console memory owner
Unneeded Users
Code:
User Group Notes
-------- -------- ---------
adm adm admin privileges short of root (legacy)
halt - privileges to halt system (legacy)*
operator - privileges for operator (legacy)
shutdown - privileges to shutdown system (legacy)*
sync - privileges to sync filesystem (legacy)*
* I think the idea behind these was that the password was shared with anybody who needed to carry out the task; the shell for that user was set to the appropriate program, so if you tried to log in as 'sync' the system would execute /bin/sync.
Optional Users/Groups
Code:
User Group Notes
-------- -------- ---------
dbus dbus System message bus (dbus-daemon—it's not running on my Linode)
- dip ?
- disk ?
exim exim default MTA for CentOS
- floppy Owns the floppy drive—irrelevant on a Linode
ftp ftp ftp daemon
games games games software (to allow writing high scores to shared file)
gopher gopher gopher daemon
haldaemon haldaemon hardware abstraction layer daemon (hald--it's not running on my Linode)
- kmem ?
- lock ?
lp lp Printer privileges. Owns /dev/lp*--irrelevant on a Linode.
I deleted the device nodes, too.
mail mail mail privileges
- man Owns man pages
- mem ?
news news news privileges
nobody nobody used by NFS and some other programs (e.g. default Apache
runs as nobody/nogroup?); legacy username/group that should
not own any files or directories, hence considered a safe
default UID/GID because it can't affect anything but world
accessible resources.
sshd sshd ssh daemon (but seriously—how can you not be running sshd?)
- slocate ?
- sys ?
- tty ?
- users ?
- utempter ?
- utmp ?
uucp UUCP uucp privileges
- wheel Restrict users allowed to su to root (legacy).
Not enforced unless enabled in PAM. Better option is to use
sudo and lock down root completely.
Out of this, I think I can do without adm, lp, news, uucp, haldaemon, halt, operator, shutdown, sync, dbus, exim, ftp, games, gopher, and groups dbus, dip, ftp, floppy, games, gopher, haldaemon, news sys.
Here's a script to delete the ones I think I can do without so far:
Code:
# Home is /var/adm, which doesn't even exist?
# No other files
userdel adm
groupdel adm
# Homes are system directories (/, /root, /sbin)
for USER in haldaemon halt operator shutdown sync dbus; do
userdel $USER;
done
# Home is /var/spool/exim, which
# should be deleted by removing package, but
# the user, group and other files are still left
userdel -r exim
groupdel exim
rm -rf /etc/pki/tls/certs/exim.pem \
/etc/pki/tls/private/exim.pem \
/var/spool/exim/ \
/var/log/exim/ \
/etc/exim
# Home is /var/ftp, which doesn't even exist?
userdel ftp
# Home is /usr/games, which is empty
# May be part of FHS?
userdel games
# Home is /var/gopher, which doesn't even exist?
userdel gopher
# Home is /var/spool/lpd, but it's not owned by
# lp and isn't removed by userdel -r
# CUPS isn't even installed, so log is unneeded
# group lp owns /dev/parport*
rm -rf /var/spool/lpd \
/var/log/cups/ \
/var/cache/cups/ \
/dev/parport*
userdel -r lp
groupdel lp
# Home is /etc/news, which doesn't even exist
# Interestingly, this one doesn't have a shell at all!
userdel news
# Home is /var/spool/uucp, which doesn't even exist
# Serial ports not needed on Linode
userdel uucp
rm -rf /dev/ttyS*
groupdel uucp
# These may have been removed already?
for GROUP in dbus dip ftp floppy games gopher haldaemon news sys; do
groupdel "$GROUP"
done
Comments?