0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

xinetdのサービスのport番号を知る方法

Posted at

とあるサービスのport番号がわからなくて、xinetdで起動してることは知ってたので /etc/xinetd を見てもportぽいものがなにもない。

xinetd の service という項目を見る

xinetdのconfは service 名で書くこともできるとのこと。

試しに time というサービスの例。

# cat /etc/xinetd.d/time-stream
service time               <--------------- ここでport番号が実は定義されている
{
   ...

port番号は /etc/services に書いてある

port番号は /etc/services でわかる

# cat /etc/services  | grep time | head -5
daytime         13/tcp
daytime         13/udp
time            37/tcp          timserver              <---------- あった!
time            37/udp          timserver              <---------- あった!
utime           519/tcp         unixtime

いつも /etc/services を忘れてしまう

おまけ listenしてるポートを知る方法 netstat -nltpa

# netstat -nltpa
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
...
tcp6       0      0 :::21                  :::*                    LISTEN      3247/xinetd       <------- このポートはxinetdだなーがわかる
tcp6       0      0 :::873                 :::*                    LISTEN      3247/xinetd

おわりに

*この記事のコマンド結果はすべて捏造したので信用しないでね

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?