"Bash: netstat: command not found"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight , -</source> +</syntaxhighlight>))
 
2번째 줄: 2번째 줄:
==문제상황==
==문제상황==
{{참고|netstat 없이 netstat 확인}}
{{참고|netstat 없이 netstat 확인}}
<source lang='console'>
<syntaxhighlight lang='console'>
root@debian:~# netstat -tnlp
root@debian:~# netstat -tnlp
bash: netstat: command not found
bash: netstat: command not found
</source>
</syntaxhighlight>


==해결방법==
==해결방법==
12번째 줄: 12번째 줄:
:(데비안/우분투) [[apt install net-tools]]
:(데비안/우분투) [[apt install net-tools]]
:(CentOS) [[yum install net-tools]]
:(CentOS) [[yum install net-tools]]
<source lang='bash'>
<syntaxhighlight lang='bash'>
apt install net-tools
apt install net-tools
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
root@debian:~# apt install net-tools
root@debian:~# apt install net-tools
Reading package lists... Done
Reading package lists... Done
33번째 줄: 33번째 줄:
Unpacking net-tools (1.60+git20161116.90da8a0-1ubuntu1) .................]  
Unpacking net-tools (1.60+git20161116.90da8a0-1ubuntu1) .................]  
Setting up net-tools (1.60+git20161116.90da8a0-1ubuntu1) ................]
Setting up net-tools (1.60+git20161116.90da8a0-1ubuntu1) ................]
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
root@debian:~# netstat -tnlp
root@debian:~# netstat -tnlp
Active Internet connections (only servers)
Active Internet connections (only servers)
40번째 줄: 40번째 줄:
tcp        0      0 0.0.0.0:22              0.0.0.0:*              LISTEN      1190/sshd       
tcp        0      0 0.0.0.0:22              0.0.0.0:*              LISTEN      1190/sshd       
tcp6      0      0 :::22                  :::*                    LISTEN      1190/sshd       
tcp6      0      0 :::22                  :::*                    LISTEN      1190/sshd       
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2021년 9월 24일 (금) 23:37 기준 최신판

1 문제상황[ | ]

root@debian:~# netstat -tnlp
bash: netstat: command not found

2 해결방법[ | ]

  • netstat 대신 리눅스 ss -lnp를 사용하는 방법도 있다.
  • netstat( net-tools )를 설치하려면...
(데비안/우분투) apt install net-tools
(CentOS) yum install net-tools
apt install net-tools
root@debian:~# apt install net-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  net-tools
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 194 kB of archives.
After this operation, 803 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 net-tools amd64 1.60+git20161116.90da8a0-1ubuntu1 [194 kB]
Fetched 194 kB in 2s (106 kB/s)                      
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package net-tools.
(Reading database ... 9703 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-1ubuntu1_amd64.deb ...
Unpacking net-tools (1.60+git20161116.90da8a0-1ubuntu1) .................] 
Setting up net-tools (1.60+git20161116.90da8a0-1ubuntu1) ................]
root@debian:~# netstat -tnlp
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      1190/sshd       
tcp6       0      0 :::22                   :::*                    LISTEN      1190/sshd

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}