๐Ÿฅ

[centos 7] telnet์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์„ ๋•Œ port ์˜คํ”ˆ ํ™•์ธ ๋ณธ๋ฌธ

linux

[centos 7] telnet์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์„ ๋•Œ port ์˜คํ”ˆ ํ™•์ธ

•8• 2023. 3. 2. 15:11
cat < /dev/tcp/host name or ip/port

ex1) ๋ฐฉํ™”๋ฒฝ open ๋˜์–ด ์žˆ๊ณ  ํฌํŠธ listen ์ค‘์ผ ๋•Œ
[centos@test-1 ~]$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_7.4

ex2) ๋ฐฉํ™”๋ฒฝ open ๋˜์–ด์žˆ์ง€๋งŒ ํฌํŠธ๊ฐ€ listen ์ค‘์ด ์•„๋‹ ๋•Œ
[centos@test-1 ~]$ cat < /dev/tcp/127.0.0.1/22
-bash: connect: Connection refused
-bash: /dev/tcp/127.0.0.1/2222: Connection refused

ex3) ๋ฐฉํ™”๋ฒฝ open์ด ๋˜์–ด์žˆ์ง€ ์•Š์„ ๋•Œ
[centos@test-1 ~]$ cat < /dev/tcp/127.0.0.1/3333
-> ๊ฒฐ๊ณผ ์ถœ๋ ฅ ๋ฐ”๋กœ ๋˜์ง€ ์•Š์Œ