"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>


==해결방법==
==해결방법==
* netstat 대신 [[리눅스 ss -lnp]]를 사용하는 방법도 있다...
* netstat 대신 [[리눅스 ss -lnp]]를 사용하는 방법도 있다.
* 여기서는 netstat( net-tools )를 설치한다.
* netstat( net-tools )를 설치하려면...
<source lang='bash'>
:(데비안/우분투) [[apt install net-tools]]
:(CentOS) [[yum install net-tools]]
<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
31번째 줄: 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)
38번째 줄: 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 }}