Re: nis : how to avoid user1 becoming user2 using local root ?

From: Brian Hatch (bri_at_ifokr.org)
Date: 03/31/04

  • Next message: Gord Philpott: "iptables firewall script for debian-woody, 2.4.24"
    Date: Wed, 31 Mar 2004 10:24:35 -0800
    To: phaser-X <px@zeroday.net>
    
    
    

    > I have the same problem at my office and I found a simple solution that is
    > very unsecure and can easily be fixed since the user is allowed root on
    > their workstations, but they also must have an understanding of PAM.
    > Basically, just edit /etc/pam.d/su and comment out (or remove) the line
    > that says "auth sufficient /lib/security/pam_rootok.so" .. This
    > way if the user becomes root locally, and then tries to 'su' to another
    > user, it will require root to enter that users password in order to change
    > to that user. Again, if the user has an understanding of PAM, they can
    > easily fix and be able to 'su' again.

    But they need not use su at all, they could compile their own su-like
    program, or do anything that does a suid, for example

            perl -e '$> = $< = 100; exec "/bin/bash"'

    Assuming the target uid is 100, you're set. (You can setgid using $(
    and $) as well.)

    As meantioned, kernel 2.6 supports NFSv4, which has much better
    security. But smbmount is still an option as well. For example
    give them the ability to run 'sudo mount /my/samba/share' where
    this is the entry in /etc/fstab:

       //sambaserver/sharename /my/samba/share \
          smbfs //user,username=SAMBAUSERNAME,uid=USERNAME,gid=GROUPID,noauto \
          0 0

    Replace capitals as appropriate. The mount will require their password for
    the samba share, and so all read/write acls are done as that user on the
    server. Now this does mean that if multiple people have root on this box,
    anyone can access //sambaserver/sharename as the user who has it
    mounted. However no one, including the mounting party, could access it
    as any other arbitrary user.

    --
    Brian Hatch                  "I believe it."
       Systems and               "If Entil'Zha believes it, I believe it."
       Security Engineer         "I'll be in the car."
    http://www.ifokr.org/bri/
    Every message PGP signed
    
    



  • Next message: Gord Philpott: "iptables firewall script for debian-woody, 2.4.24"

    Relevant Pages

    • Re: Binary upgrade available
      ... > This took me a while to figure out, but my understanding is this: ... > The parent sshd process, ... I checked with lsof while an ssh session was in progress, ... There also are no processes owned by "sshd", only by root (marked ...
      (FreeBSD-Security)
    • Re: RISC OS Six buttons
      ... understanding the difference between ordinary users and the root user ... Ubuntu doesn't even have a root account enabled by default -- the first ... bottom dollar most Mac users don't know the difference between root ...
      (comp.sys.acorn.misc)
    • Re: question on migrate content databases
      ... V2UsedHostHeaderMode -pv true" not understanding what host header mode ... Once I put that back the content databases would connect to the root ...
      (microsoft.public.sharepoint.windowsservices)
    • Re: How to eliminate a "whole lot of wondering"
      ... CodeGear could try to figure out some *root* problems ... and be successful in understanding them and setting ...
      (borland.public.delphi.non-technical)
    • Re: Software for distribution of configuration files and changes
      ... accepting keyboard-interactive/pam. ... This affects all users, and not just root. ... But without PAM, sshd just prompts for password in a little different way. ...
      (freebsd-stable)

  • Quantcast