0

Basically, I'm running a Mac Mini as a server, and I'm trying to close some security holes. My server has 3 users: admin, git, and server. Each user has public key authentication enabled, while only git has password authentication enabled. However, once a user is logged in as any account, they can use su to log in as other users with password authentication.

What I'd like to do is disable the su command for users logged via ssh as git or server, so that a potential black hat cannot access the other users' files by logging in as them with a password. If this cannot be done specifically for ssh connections, disabling the command for those two accounts altogether would be fine. However, I do want to be able to use su as admin, so disabling the command altogether is not an option.

I basically want the ONLY way you could access admin via ssh to be with a valid public key only collected from sysadmins, and disable access for users who have keys for git or server and then the user password for admin.

Is this at all possible? How would I go about doing it?

8
  • 1
    Did those users get into the wheel group? Who put them in there? Aug 3, 2018 at 16:05
  • @MichaelHampton As far as I can tell, using id and groups, none of my three users are a part of the wheel group. Possibly a quirk of macOS? Aug 3, 2018 at 17:10
  • I reread your question. It seems like you aren't trying to prevent su to root, but to other user accounts? If that is the case, then change passwords. Aug 3, 2018 at 17:17
  • @MichaelHampton Yes that's right. I should add that I'm doing this preventatively for a potential incident, not in response to cracked passwords. The root account is disabled on my mac, and I don't intend to enable it unless I need to. I've added another paragraph (3) to my question to be more specific. Aug 3, 2018 at 17:31
  • Why do these accounts need passwords at all, then? Make everyone log in exclusively with ssh keys. Aug 3, 2018 at 19:10

0

You must log in to answer this question.

Browse other questions tagged .