Kali2020 缺少ifconfig命令
在kali 2020上使用ifconfig,报错ifconfig not found。
一开始以为是没有安装net-tools工具包
sudo apt-get install net-tools
安装完成之后发现还是有问题,还是输入没有命令
但使用命令 sudo ifconfig 可查看ip,但这样很麻烦
解决方案
找到ifconfig这个程序,通过绝对路径运行ifconfig程序
deroy@kali:~/桌面$ sudo which ifconfig
/usr/sbin/ifconfig
deroy@kali:~/桌面$ /usr/sbin/ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500...
添加环境变量
1. 查找到ifconfig的路径
sudo which ifconfig (/usr/sbin/ifconfig)
2. 编辑~/.bashec文件
vim ~/.bashrc
3. 末尾加入下面内容
export PATH=/usr/sbin/:$PATH
4. 更新~/.bashec文件
source ~/.bashsv
5. 再次执行ifconfig命令
eroykali:~/桌面$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.67.131 netmask 255.255.255.0 broadcast 192.168.67.255
inet6 fe80::20c:29ff:fe97:dc3a prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:97:dc:3a txqueuelen 1000 (Ethernet)
RX packets 42 bytes 13868 (13.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 29 bytes 2697 (2.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 16 bytes 796 (796.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 16 bytes 796 (796.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0