centos下什麼是nc
centos下的nc是「netcat」的簡稱,是網路工具,可以用於連接埠掃描、檔案傳輸等,nc也可以實現任意TCP和UDP連接埠的偵聽,可以利用「yum install nc -y”指令進行安裝。
本文操作環境:centos 7系統、Dell G3電腦。
centos下什麼是nc
nc是netcat工具的簡稱,網路工具,可以用來連接埠掃描、檔案傳輸等功能。
centos上面安裝也很簡單:
yum install nc -y
nc常用功能
實作任意TCP /UDP連接埠的偵聽,nc可以作為server以TCP或UDP方式偵聽指定連接埠
連接埠的掃描,nc可以作為client發起TCP或UDP連線
#機器之間傳送檔案
機器之間網路測速
一般nc只用來做TCP/UDP協定的連接埠測試,其它功能少用!
nc幫助說明
# nc --help Ncat 7.50 ( https://nmap.org/ncat ) Usage: ncat [options] [hostname] [port] Options taking a time assume seconds. Append 'ms' for milliseconds, 's' for seconds, 'm' for minutes, or 'h' for hours (e.g. 500ms). -4 Use IPv4 only -6 Use IPv6 only -U, --unixsock Use Unix domain sockets only -C, --crlf Use CRLF for EOL sequence -c, --sh-exec <command> Executes the given command via /bin/sh -e, --exec <command> Executes the given command --lua-exec <filename> Executes the given Lua script -g hop1[,hop2,...] Loose source routing hop points (8 max) -G <n> Loose source routing hop pointer (4, 8, 12, ...) -m, --max-conns <n> Maximum <n> simultaneous connections -h, --help Display this help screen -d, --delay <time> Wait between read/writes -o, --output <filename> Dump session data to a file -x, --hex-dump <filename> Dump session data as hex to a file -i, --idle-timeout <time> Idle read/write timeout -p, --source-port port Specify source port to use -s, --source addr Specify source address to use (doesn't affect -l) -l, --listen Bind and listen for incoming connections -k, --keep-open Accept multiple connections in listen mode -n, --nodns Do not resolve hostnames via DNS -t, --telnet Answer Telnet negotiations -u, --udp Use UDP instead of default TCP --sctp Use SCTP instead of default TCP -v, --verbose Set verbosity level (can be used several times) -w, --wait <time> Connect timeout -z Zero-I/O mode, report connection status only --append-output Append rather than clobber specified output files --send-only Only send data, ignoring received; quit on EOF --recv-only Only receive data, never send anything --allow Allow only given hosts to connect to Ncat --allowfile A file of hosts allowed to connect to Ncat --deny Deny given hosts from connecting to Ncat --denyfile A file of hosts denied from connecting to Ncat --broker Enable Ncat's connection brokering mode --chat Start a simple Ncat chat server --proxy <addr[:port]> Specify address of host to proxy through --proxy-type <type> Specify proxy type ("http" or "socks4" or "socks5") --proxy-auth <auth> Authenticate with HTTP or SOCKS proxy server --ssl Connect or listen with SSL --ssl-cert Specify SSL certificate file (PEM) for listening --ssl-key Specify SSL private key (PEM) for listening --ssl-verify Verify trust and domain name of certificates --ssl-trustfile PEM file containing trusted SSL certificates --ssl-ciphers Cipherlist containing SSL ciphers to use --version Display Ncat's version information and exit
nc常用案例
TCP監聽測試
nc可作為server端192.168.10.11啟動一個tcp的監聽
nc -l 80
客戶端測試方法:直接telnet該機器ip 埠
telnet 192.168.10.11 80
或:nmap 192.168.10.11 -p 80
UDP監聽測試
#nc作為server端啟動一個udp的監聽
nc -lu 80
透過netstat可以看到udp協定已經監聽:
> # netstat -tunlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name udp 0 0 0.0.0.0:80 0.0.0.0:* 15401/nc
推薦教學:《centos教學》
以上是centos下什麼是nc的詳細內容。更多資訊請關注PHP中文網其他相關文章!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

CentOS系統下GitLab的備份與恢復策略為了保障數據安全和可恢復性,CentOS上的GitLab提供了多種備份方法。本文將詳細介紹幾種常見的備份方法、配置參數以及恢復流程,幫助您建立完善的GitLab備份與恢復策略。一、手動備份利用gitlab-rakegitlab:backup:create命令即可執行手動備份。此命令會備份GitLab倉庫、數據庫、用戶、用戶組、密鑰和權限等關鍵信息。默認備份文件存儲於/var/opt/gitlab/backups目錄,您可通過修改/etc/gitlab

提升CentOS上HDFS性能:全方位優化指南優化CentOS上的HDFS(Hadoop分佈式文件系統)需要綜合考慮硬件、系統配置和網絡設置等多個方面。本文提供一系列優化策略,助您提升HDFS性能。一、硬件升級與選型資源擴容:盡可能增加服務器的CPU、內存和存儲容量。高性能硬件:採用高性能網卡和交換機,提升網絡吞吐量。二、系統配置精調內核參數調整:修改/etc/sysctl.conf文件,優化TCP連接數、文件句柄數和內存管理等內核參數。例如,調整TCP連接狀態和緩衝區大小

CentOS 關機命令為 shutdown,語法為 shutdown [選項] 時間 [信息]。選項包括:-h 立即停止系統;-P 關機後關電源;-r 重新啟動;-t 等待時間。時間可指定為立即 (now)、分鐘數 ( minutes) 或特定時間 (hh:mm)。可添加信息在系統消息中顯示。

CentOS下Hadoop分佈式文件系統(HDFS)配置常見問題及解決方案在CentOS系統上搭建HadoopHDFS集群時,一些常見的錯誤配置可能導致性能下降、數據丟失甚至集群無法啟動。本文總結了這些常見問題及其解決方法,幫助您避免這些陷阱,確保HDFS集群的穩定性和高效運行。機架感知配置錯誤:問題:未正確配置機架感知信息,導致數據塊副本分佈不均,增加網絡負載。解決方案:仔細檢查hdfs-site.xml文件中的機架感知配置,並使用hdfsdfsadmin-printTopo

CentOS 和 Ubuntu 的關鍵差異在於:起源(CentOS 源自 Red Hat,面向企業;Ubuntu 源自 Debian,面向個人)、包管理(CentOS 使用 yum,注重穩定;Ubuntu 使用 apt,更新頻率高)、支持週期(CentOS 提供 10 年支持,Ubuntu 提供 5 年 LTS 支持)、社區支持(CentOS 側重穩定,Ubuntu 提供廣泛教程和文檔)、用途(CentOS 偏向服務器,Ubuntu 適用於服務器和桌面),其他差異包括安裝精簡度(CentOS 精

優雅安裝 MySQL 的關鍵在於添加 MySQL 官方倉庫。具體步驟如下:下載 MySQL 官方 GPG 密鑰,防止釣魚攻擊。添加 MySQL 倉庫文件:rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm更新 yum 倉庫緩存:yum update安裝 MySQL:yum install mysql-server啟動 MySQL 服務:systemctl start mysqld設置開機自啟動

CentOS 中配置 IP 地址的步驟:查看當前網絡配置:ip addr編輯網絡配置文件:sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0更改 IP 地址:編輯 IPADDR= 行更改子網掩碼和網關(可選):編輯 NETMASK= 和 GATEWAY= 行重啟網絡服務:sudo systemctl restart network驗證 IP 地址:ip addr

CentOS將於2024年停止維護,原因是其上游發行版RHEL 8已停止維護。該停更將影響CentOS 8系統,使其無法繼續接收更新。用戶應規劃遷移,建議選項包括CentOS Stream、AlmaLinux和Rocky Linux,以保持系統安全和穩定。
