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.
That's something of an odd setup -- /home, /usr/src, /usr/local, and /var/local should probably not have the setgid bit on them. So too with most of the *directories* that you say are setgid. write and wall definitely have to be setgid tty so they can write to all the terminal devices, but most of the rest look spurious.
As for your setuid files -- it appears most of them need to be as they are. passwd must be setuid for instance since only root has permission to write to the password file. I don't see any file in that group that doesn't look out of place.
I think the important thing is to also know *what* group or user they're setgid/setuid to, and what the reason is. Setuid root for some apps is necessary to get read rights or open a privileged port (below 1024). If it's an app without respect for good programming practices (drop privs RSN, run as lesser priv'ed user), ACL's (PAM aware apps) or workaround (allow specific switch tru sudo) and no real necessity, then by all means test unsetting the bit. To get indepth info on an apps maintenance status you gotta research some. Look at the changelogs and search Google/Linuxsecurity.com/Securityfocus.com/Bugtraq for (past) vulnerabilities and exploits makes for a nice start. Granted, it's laborious, but this will definately give you better insight in trouble with some apps.
Unset if you don't want users to:
### SGID ###
/usr/bin/wall # talk
/usr/bin/chage # view their own passwd aging
/usr/bin/expiry # dunno. This a passwd thing?
/usr/bin/write # write messages to other users terminals
/usr/bin/dotlockfile # dunno
### SUID ###
/usr/bin/newgrp # switch/change their current sessions group rights
/usr/bin/chfn # change finger info
/usr/bin/chsh # change shells
/usr/bin/gpasswd # passwd group nfo
/usr/bin/passwd # password user nfo
/usr/bin/at # run At jobs (also see /etc/at.{deny,allow})
/usr/bin/crontab # edit their crontab (also see /etc/cron.{deny,allow})
/usr/sbin/exim # <- this could be a necessary pain. Hope it drops root privs.
/usr/sbin/pppd # <- this could be a necessary pain. Hope it drops root privs or restrict with sudo.
/usr/lib/pt_chown # <- Glibc necessity unless you run dev{pts}fs
/sbin/unix_chkpwd # dunno?
/bin/login # setuid not needed AFAIK
/bin/su # change user (set up specific tasks tru sudo instead)
/bin/mount # mount/unmount stuff (also see mount flags)
/bin/umount # mount/unmount stuff (also see mount flags)
/bin/ping # ping hosts (firewall)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.