CentOS安装netcat工具及测试

下载安装

1
2
3
4
5
6
7
8
9
# 下载
wget https://sourceforge.net/projects/netcat/files/netcat/0.7.1/netcat-0.7.1.tar.gz
# 解压
tar -zxvf netcat-0.7.1.tar.gz -C /usr/local
cd /usr/local
# 安装
cd /usr/local/netcat-0.7.1
./configure
make && make install

如果./configure报错:configure: error: no acceptable C compiler found in $PATH,就下载yum install gcc -y来解决,完事重新执行命令即可。

配置

vim /etc/profile
添加以下内容:

1
2
export NETCAT_HOME=/usr/local/netcat-0.7.1
export PATH=$PATH:$NETCAT_HOME/bin

保存,退出,并使配置生效:
source /etc/profile

测试

nc --help