Find the answer to your Linux question:
Results 1 to 7 of 7
Hi everyone, I have installed redhat on the vmware and i have installed all the rpms using the GUI. But when i try running TCPDUMP command it says" Command not ...
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    6

    Not able to run TCPDUMP even though it is installed

    Hi everyone,

    I have installed redhat on the vmware and i have installed all the rpms using the GUI. But when i try running TCPDUMP command it says" Command not found".
    I am able to locate it and when i query for it using the command "rpm -q tcpdump" it shows tcpdump-3.7.2-1. This means tcpdump command is installed but when i run "sudo tcpdump" it says" command not found". Please help me in this regard. Thanks in advance.

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    tcpdump is not in your $PATH, only in root´s $PATH.
    So it is not enough to have root privileges (which you get via sudo).

    You could become root:
    sudo su -
    and then execute
    tcpdump

    Or you can enter the pathname:
    sudo /usr/sbin/tcpdump

  3. #3
    Just Joined!
    Join Date
    Jul 2009
    Posts
    6
    Thanks a lot. "sudo /usr/sbin/tcpdump" worked..
    But the first one

    "You could become root:
    sudo su -
    and then execute
    tcpdump"

    this didnt work. It again said "command not found". If u can tell me the reason for this it would be great. Anyways thank you..

  4. #4
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    /usr/sbin should be in $PATH, after you become root.

    Please do it again
    sudo su -
    (note the - )
    and then
    echo $PATH

    There should be "/sbin" and "/usr/sbin" among them

  5. #5
    Just Joined!
    Join Date
    Jul 2009
    Posts
    6
    I tried executing with "sudo su -" but it says"bumblebee is not in the sudoers file. This incident will be reported".

  6. #6
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    This leaves the scope of the original question, but ok

    sudo on your computer is configured in a way that it does allow you to execute tcpdump with root privileges.
    But the environment is still that of the user bumblebee.

    To see it, type: env
    You will notice, that your $PATH does not have (or better: not need) /sbin and /usr/sbin

    This is why "sudo tcpdump" returns a file not found error.
    sudo /usr/sbin/tcpdump works, because you explicitly tell where to look for tcpdump


    As for the "bumblebee is not in the sudoers file. This incident will be reported". message.
    That means, you are not allowed to use the programm su with sudo.
    This is defined in /etc/sudoers

    As you no doubt have figured out by now:
    sudo is used to give normal users access to _some_ privileged programs, without giving the root password to everyone.
    (in theory all programs, but that would be against security and good practice)

    Further info:
    man sudo

  7. #7
    Just Joined!
    Join Date
    Jul 2009
    Posts
    6
    Thanks a lot for the info..

Posting Permissions

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