Find the answer to your Linux question:
Results 1 to 4 of 4
hi forum, I'm installing an application server for my team which need to give the option for a user to run snmptrapd. What basically is going to happen is the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Location
    San Jose, CA
    Posts
    2

    SNMP trap handler (snmptrapd)


    hi forum,

    I'm installing an application server for my team which need to give the option for a user to run snmptrapd.
    What basically is going to happen is the user login, it gets a menu and select an option to run snmptrapd.

    when i login with the user and run snmptrapd this is what i get:

    snmptrapd -f -C -c /usr/local/etc/snmp/snmptrapd.conf -Le

    couldn't open udp:162 -- errno 13 ("Permission denied")

    It works fine if i run it as root but need to give the user the option to run it as well without root:

    Current shell for trapadmin:

    [root at asteriskvnt trapadmin]# chsh trapadmin
    Changing shell for trapadmin.
    New shell [/bin/rbash]: ^C

    [root at asteriskvnt sbin]# pwd
    /usr/local/sbin

    [root at asteriskvnt sbin]# ls snmptrapd -al
    -rwxrwxrwx 1 root root 47792 2009-08-20 15:47 snmptrapd

    So not sure which permissions should I modify or path for troubleshooting

    Thanks

  2. #2
    Linux Guru gogalthorp's Avatar
    Join Date
    Oct 2006
    Location
    West (by God) Virginia
    Posts
    3,104
    You can do it by giving permission to a group then make the user a member of that group or simply give all permission.

    at a command prompt get all then info on chmod to change permissions with

    man chmod


    You can also do it graphically but you must be the owner or root (File Manager-Super user mode) Right click and select Properties-Permissions

  3. #3
    Just Joined!
    Join Date
    Sep 2009
    Location
    San Jose, CA
    Posts
    2
    thanks for replying, I have root access to CLI only
    This is what I did:

    From root:

    [root@asteriskvnt sbin]# ls -al
    total 100
    drwxr-xr-x 2 root root 4096 2009-08-20 15:47 .
    drwxr-xr-x 12 root root 4096 2009-08-20 16:02 ..
    -rwxr-xr-x 1 root root 43515 2009-08-20 15:46 snmpd
    -rwxrwxrwx 1 root root 47792 2009-08-20 15:47 snmptrapd

    then to make sure im not using incorrect snmptrapd:

    [root@asteriskvnt sbin]# find / -name snmptrapd
    /usr/local/net-snmp/net-snmp-5.5.rc1/apps/snmptrapd
    /usr/local/net-snmp/net-snmp-5.5.rc1/apps/.libs/snmptrapd
    /usr/local/net-snmp/net-snmp-5.5.rc1/win32/snmptrapd
    /usr/local/sbin/snmptrapd


    [root@asteriskvnt sbin]# chgrp telepresence /usr/local/net-snmp/net-snmp-5.5.rc1/apps/snmptrapd
    [root@asteriskvnt sbin]# chgrp telepresence /usr/local/net-snmp/net-snmp-5.5.rc1/apps/.libs/snmptrapd
    [root@asteriskvnt sbin]# chgrp telepresence /usr/local/net-snmp/net-snmp-5.5.rc1/win32/snmptrapd
    [root@asteriskvnt sbin]# chgrp telepresence /usr/local/sbin/snmptrapd

    [root@asteriskvnt sbin]# ls -al
    total 100
    -rwxrwxrwx 1 root telepresence 47792 2009-08-20 15:47 snmptrapd


    [sdharmar@asteriskvnt ~]$ whoami
    sdharmar
    [sdharmar@asteriskvnt ~]$ groups
    telepresence users
    [sdharmar@asteriskvnt ~]$ snmptrapd -f -C -c /usr/local/etc/snmp/snmptrapd.conf -Le
    couldn't open udp:162 -- errno 13 ("Permission denied")

    After that failure is still there.
    snmptrapd will open the port 162 in the system, and this user has /bin/rbash not sure if its related

    Thanks

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Nov 2009
    Posts
    1

    snmptrapd Permission Denied

    Hi..

    Port 162 is a privileged port. It can only be bound to if you are root user.
    Currently as i see, you are trying to start the service as a non-root user.
    That would not be possible. There are certain things which only a root user is allowed to do in Linux, like inserting driver modules, changing kernel parameters with sysctl and then this.
    Hope this helps.

Posting Permissions

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