FedoraForum.org - Fedora Support Forums and Community
Results 1 to 1 of 1
  1. #1
    basten999 Guest

    how to use pam_cap.so??

    i want to let the non-privilege user have some privileges. and i think libcap-2.14 can help me to do that !
    for a test, i want user basten has CAP_NET_RAW , so i have done some jobs :
    1. download libcap-2.14.tar.gz
    2. configure, make and make install
    3. edit /etc/security/capability.conf, add a line '13 basten' , the file is
    # /etc/security/capability.conf
    #
    # this is a sample capability file (to be used in conjunction with
    # the pam_cap.so module)
    #
    # In order to use this module, it must have been linked with libcap
    # and thus you'll know about Linux's capability support.
    # [If you don't know about libcap, the sources for it are here:
    #
    # http://linux.kernel.org/pub/linux/li...y/linux-privs/
    #
    # .]
    #
    # Here are some sample lines (remove the preceding '#' if you want to
    # use them

    ## user 'morgan' gets the CAP_SETFCAP inheritable capability
    #cap_setfcap morgan

    ## user 'luser' inherits the CAP_DAC_OVERRIDE capability
    #cap_dac_override luser
    13 basten
    ## 'everyone else' gets no inheritable capabilities
    none *

    ## if there is no '*' entry, all users not explicitly mentioned will
    ## get all available capabilities. This is a permissive default, and
    ## probably not what you want...

    4. edit /etc/pam.d/login, add a line 'auth required pam_cap.so', the file is
    #%PAM-1.0
    auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
    auth include system-auth
    auth required pam_cap.so
    account required pam_nologin.so
    account include system-auth
    password include system-auth
    # pam_selinux.so close should be the first session rule
    session required pam_selinux.so close
    session include system-auth
    session required pam_loginuid.so
    session optional pam_console.so
    # pam_selinux.so open should only be followed by sessions to be executed in the user context
    session required pam_selinux.so open
    session optional pam_keyinit.so force revoke

    5. reboot and login as user basten
    6. /usr/sbin/getpcaps $$
    [basten@localhost ~]$ /usr/sbin/getpcaps $$
    Capabilities for `27296': =
    [basten@localhost ~]$


    the capability CAP_NET_RAW is not allowed for user basten

    who can help me to do that ?? thank you very much!!

    PS: my OS is RHEL5.1 my kernel is linux 2.6.26.6-49
    Last edited by basten999; 12th November 2008 at 10:18 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •