我已经在我的 Ubuntu 8.04 上安装了 Hping3,但是安装后当我想要使用 Hping3 时出现了这个错误:
Command 'hping3' is available in '/usr/sbin/hping3'
The command could not be located because '/usr/sbin' is not included in
the PATH environment variable.
This is most likely caused by the lack of administrative privileges
associated with your user account.
当我尝试运行时,ifconfig
我也得到了这个:
Command 'ifconfig' is available in '/sbin/ifconfig'
The command could not be located because '/sbin' is not included in
the PATH environment variable.
This is most likely caused by the lack of administrative privileges
associated with your user account.
首先我需要运行sudo su
,然后运行命令。这是正常的吗?还是我遗漏了什么?
当我跑步时echo $PATH
我得到:
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/amirreza/simulator/ns-allinone-2.33/bin:/home/amirreza/simulator/ns-allinone-2.33/tcl8.4.18/unix:/home/amirreza/simulator/ns-allinone-2.33/tk8.4.18/unix:/home/amirreza/simulator/ns-allinone-2.33/ns-2.33/:/home/amirreza/simulator/ns-allinone-2.33/nam-1.14/
答案1
hping 通常需要以 root 身份运行(就像许多其他网络分析工具一样)。
也就是说,和都/sbin
应该/usr/sbin
在您的 $PATH 中。无法运行 ifconfig 绝对不正常,而且很烦人。以下是我的 $PATH,供您参考:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
您可以使用 显示它echo $PATH
并使用 编辑它export
,如下所示:
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
附言:我的根 $PATH 是
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
... 万一。