NetCat传输数据

必须关闭防火墙!!!

Linux关闭防火墙:

systemctl status firewalld ====== 查看Linux防火墙状态

systemctl stop firewalld ====== 关闭Linux防火墙

systemctl start firewalld ====== 开启Linux防火墙

systemctl restart firewalld ====== 重启Linux防火墙

systemctl disable firewalld ====== 禁用Linux防火墙

Windows间传输:

1、安装NetCat

2、开启服务端:nc -l -p 9999

3、开启客户端:nc localhost 9999

4、客户端和服务端间通信

Linux间传输:

1、yum search ncat ====== 搜索ncat所在的安装包

2、sudo yum -y install nmap-ncat ====== 安装ncat软件

3、开启服务端:nc -l -p 9999

4、查看端口是否开启:netstat -anop | grep 9999

4、开启客户端:nc localhost 9999

Linux和Windows间传输:

Linux ==>> Windows(传文件里的数据到文件):

1、Windows开启服务端:nc -l -p 9999 >> bbb.txt

2、Linux开启客户端:nc ip 9999 < b.txt (ip写Windows端的IP地址,新版本不需指定参数"-w 1",旧版本需要)

Windows ==>> Linux(传文件里的数据到文件):

1、Linux开启服务端:nc -l -p 9999 >> bbb.txt

2、Windows开启客户端:nc -w 1 p 9999 < b.txt (ip写服务端的IP地址,"-w 1"表示传输完成1秒后自动关闭连接)

 

 

猜你喜欢

转载自blog.csdn.net/foyemazl/article/details/81264960