概要
外部からサーバにアクセスするためには、サーバ側でportが開いている必要がある。 逆にいえば、サーバ側のportが1つも開いていなければ外部から侵入することはできない
check port
- confirm opened port
netstat -ntl
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 :::22 :::* LISTEN tcp 0 0 ::1:631 :::* LISTEN tcp 0 0 ::1:25 :::* LISTEN
※開いてるportは 22,631,25 0.0.0.0 → すべてのIPに対してopen 127.0.0.1 → 自分のみ
不要なportがある場合はdeamonを終了させること