×ðÁú¿­Ê±

linuxÔõôÉó²éÀú³Ì¶Ë¿Ú

ÔÚ linux ϵͳÖУ¬Éó²éÀú³Ì¶Ë¿Ú¿Éͨ¹ýÒÔÏÂÒªÁ죺netstat ÏÂÁnetstat -apn£ºÏÔʾËùÓÐÀú³ÌµÄ¶Ë¿Ú°ó¶¨¡£netstat -tulpn£ºÏÔʾ½ö tcp ºÍ udp ¶Ë¿Ú¡£netstat -lntp£ºÏÔʾ½öÕìÌý¶Ë¿Ú¡£lsof ÏÂÁlsof -i -p£ºÏÔʾʹÓÃÍøÂçÅþÁ¬µÄÀú³ÌºÍ¶Ë¿ÚºÅ¡£lsof -i4tcp:port£ºÏÔʾ¼àÌýÌض¨ tcp ¶Ë¿ÚµÄÅþÁ¬¡£lsof -i4udp:port£ºÏÔʾ¼àÌýÌض¨ udp ¶Ë¿ÚµÄÅþÁ¬¡£ss ÏÂÁss -tulpn£ºÏÔʾËùÓÐ tcp ºÍ udp

ÔõÑùÉó²é Linux Àú³Ì¶Ë¿Ú

ÔÚ Linux ϵͳÖУ¬¿ÉÒÔÇáËÉÉó²éÀú³ÌÕýÔÚ¼àÌýÄÄЩ¶Ë¿Ú¡£Õâ¹ØÓÚ¹ÊÕÏɨ³ý¡¢ÍøÂçÖÎÀíºÍÇå¾²ÐÔÖÁ¹ØÖ÷Òª¡£

ÒªÁì 1£ºÊ¹Óà netstat ÏÂÁî

netstat ÏÂÁîÊÇ×î³£ÓõÄÒªÁ죺

netstat -apn ÁгöËùÓÐÀú³ÌµÄ¶Ë¿Ú°ó¶¨£¬°üÀ¨Àú³Ì ID (PID) ºÍÏÂÁîÃû³Æ¡£

netstat -tulpn ½öÁгö TCP ºÍ UDP ¶Ë¿Ú¡£

netstat -lntp ½öÁгöÕìÌý¶Ë¿Ú¡£

ÒªÁì 2£ºÊ¹Óà lsof ÏÂÁî

lsof ÏÂÁî¿ÉÒÔÁгöËùÓз­¿ªµÄÎļþºÍÍøÂçÅþÁ¬£º

lsof -i -P ÁгöËùÓÐÕýÔÚʹÓÃÍøÂçÅþÁ¬µÄÀú³Ì£¬°üÀ¨¶Ë¿ÚºÅºÍÀú³Ì ID¡£

lsof -i4TCP:port ½öÁгöÕìÌýÌض¨¶Ë¿ÚµÄ TCP ÅþÁ¬¡£

lsof -i4UDP:port ½öÁгöÕìÌýÌض¨¶Ë¿ÚµÄ UDP ÅþÁ¬¡£

ÒªÁì 3£ºÊ¹Óà ss ÏÂÁî

ss ÏÂÁîÊǽÏеÄÏÂÁÌṩÁ˸ü¸ß¼¶µÄ¹¦Ð§£º

ss -tulpn ÁгöËùÓÐ TCP ºÍ UDP ¶Ë¿Ú£¬°üÀ¨Àú³Ì ID ºÍ״̬¡£

ss -s ÏÔʾÿ¸öЭÒéµÄͳ¼ÆÐÅÏ¢¡£

ss -lntp ½öÁгöÕìÌý¶Ë¿Ú¡£

ʾÀý£ºÊ¹Óà netstat

ÒÔÏÂÏÂÁÁгöϵͳÉÏËùÓÐÕýÔÚÕìÌý¶Ë¿ÚµÄÀú³Ì£º

netstat -lntp

µÇ¼ºó¸´ÖÆ

Êä³öÀàËÆÓÚ£º

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      6725/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      6725/sshd
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      2393/cupsd
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      646/systemd-resolved
tcp        0      0 127.0.0.1:80            0.0.0.0:*               LISTEN      24552/apache2

µÇ¼ºó¸´ÖÆ

´ËÊä³öÏÔʾÁËÎå¸öÀú³ÌÕýÔÚÕìÌý¶Ë¿Ú£¬°üÀ¨ sshd¡¢cupsd¡¢systemd-resolved ºÍ apache2¡£

ÒÔÉϾÍÊÇlinuxÔõôÉó²éÀú³Ì¶Ë¿ÚµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±ÊµÊ±ÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
¡¾ÍøÕ¾µØͼ¡¿¡¾sitemap¡¿