listen 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. .TH LISTEN 8
  2. .SH NAME
  3. listen, listen1, tcp7, tcp9, tcp19, tcp21, tcp22, tcp23, tcp25, tcp53, tcp110, tcp113, tcp143, tcp513, tcp515, tcp564, tcp565, tcp566, tcp567, tcp993, tcp995, tcp1723, tcp17007, tcp17008, tcp17009, tcp17010, tcp17013 \- listen for calls on a network device
  4. .SH SYNOPSIS
  5. .B aux/listen
  6. .RB [ -q ]
  7. .RB [ -d
  8. .IR srvdir ]
  9. .RB [ -t
  10. .IR trustsrvdir ]
  11. .RB [ -n
  12. .IR namespace ]
  13. .RI [ net ]
  14. .PP
  15. .B aux/listen1
  16. [
  17. .B -tv
  18. ]
  19. .I addr
  20. .I cmd
  21. [
  22. .I args...
  23. ]
  24. .SH DESCRIPTION
  25. .I listen
  26. listens on a network for inbound calls to local services.
  27. .I Net
  28. is the network protocol on which to listen, by default
  29. .BR /net/tcp .
  30. The services available are executable, non-empty files in
  31. .I srvdir
  32. or
  33. .IR trustsrvdir .
  34. If neither
  35. .I srvdir
  36. nor
  37. .I trustsrvdir
  38. is given,
  39. .I listen
  40. looks for executable files in
  41. .BR /bin/service .
  42. Services found in
  43. .I srvdir
  44. are executed as user
  45. .BR none ;
  46. services found in
  47. .I trustsrvdir
  48. are executed as the user who started
  49. .IR listen .
  50. When changing user to
  51. .BR none ,
  52. a new namespace is created,
  53. usually by executing
  54. .BR /lib/namespace ,
  55. but
  56. .B -n
  57. selects an alternate
  58. .IR namespace .
  59. Option
  60. .B -q
  61. suppresses affirmative log information.
  62. .PP
  63. Service names are made by concatenating the name of
  64. the network with the name of the service or port.
  65. For example,
  66. an inbound call on the TCP network for port 565 executes service
  67. .BR tcp565 .
  68. .PP
  69. At least the following services are available in
  70. .BR /bin/service .
  71. .TF \ tcp0000
  72. .TP
  73. .B tcp564
  74. serve a piece of the name space using the Plan 9 file system protocol,
  75. with authentication via
  76. .I Tauth
  77. (in
  78. .IR attach (5)),
  79. no encryption,
  80. and multiplex multiple users on a single connection
  81. (used by
  82. .IR srv (4),
  83. and also by Unix systems to see Plan 9 files).
  84. .TP
  85. .B tcp17007
  86. serve a piece of the name space using the Plan 9 file system protocol,
  87. with authentication at the start,
  88. optional SSL encryption,
  89. and no multiplexing of users
  90. (typically used by
  91. .IR cpu (1)
  92. and
  93. .IR import (4)).
  94. Not usable by user
  95. .IR none .
  96. .TP
  97. .B tcp17008
  98. like
  99. .BR tcp17007 ,
  100. but serves the root of the tree,
  101. forgoing the negotiation for which subtree to serve.
  102. .TP
  103. .B tcp17009
  104. .I rx
  105. remote execution.
  106. .TP
  107. .B tcp17010
  108. server for
  109. .IR cpu (1)
  110. command.
  111. .TP
  112. .B tcp17013
  113. server for old
  114. .IR cpu (1)
  115. command for compatibility with old clients.
  116. .TP
  117. .B tcp7
  118. echo any bytes received (bit mirror)
  119. .TP
  120. .B tcp9
  121. consume any bytes received (bit bucket)
  122. .TP
  123. .B tcp19
  124. .B chargen
  125. service.
  126. .TP
  127. .B tcp21
  128. FTP daemon
  129. .TP
  130. .B tcp22
  131. .IR ssh (1)
  132. `secure shell' encrypted terminal connection or file transfer.
  133. .TP
  134. .B tcp23
  135. .B telnet
  136. terminal connection.
  137. .TP
  138. .B tcp25
  139. mail delivery.
  140. .TP
  141. .B tcp53
  142. TCP port for DNS.
  143. .TP
  144. .B tcp110
  145. POP3 port.
  146. .TP
  147. .B tcp113
  148. .B Ident
  149. port (always reports
  150. .BR none ).
  151. .TP
  152. .B tcp143
  153. IMAP4rev1 port.
  154. .TP
  155. .B tcp513
  156. .B rlogin
  157. terminal connection.
  158. .TP
  159. .B tcp515
  160. LP daemon; see
  161. .IR lp (8).
  162. .TP
  163. .B tcp565
  164. report the address of the incoming call.
  165. .TP
  166. .B tcp993
  167. Secure IMAP4rev1 port.
  168. .TP
  169. .B tcp995
  170. Secure POP3 port.
  171. .TP
  172. .B tcp1723
  173. PPTP (point-to-point tunnelling protocol) service.
  174. .PD
  175. .PP
  176. At least the following services are available in
  177. .BR /bin/service.auth .
  178. .TF \ tcp0000
  179. .TP
  180. .B tcp566
  181. validate a SecureNet box.
  182. .TP
  183. .B tcp567
  184. Plan 9 authentication-ticket service.
  185. .PD
  186. .PP
  187. .I Listen1
  188. is a lightweight listener intended for personal use,
  189. modeled from Inferno's
  190. .\" write out this way so automatic programs
  191. .\" don't try to make it into a real man page reference.
  192. \fIlisten\fR(1).
  193. announces on
  194. .IR address ,
  195. running
  196. .I cmd
  197. .I args...
  198. for each incoming connection;
  199. the network directory is passed in the environment
  200. as
  201. .BR $net .
  202. Option
  203. .B -t
  204. causes
  205. .I listen1
  206. to run as the invoking user; the default
  207. is to become
  208. .B none
  209. before listening.
  210. Option
  211. .B -v
  212. causes verbose logging on standard output.
  213. See
  214. .B /rc/bin/tlssrvtunnel
  215. for an example.
  216. .SH FILES
  217. .TF /env/sysname
  218. .TP
  219. .B /net/tcp
  220. by convention, TCP device bind point
  221. .SH SOURCE
  222. The sources to
  223. .I listen
  224. and
  225. .I listen1
  226. are
  227. .B /sys/src/cmd/aux/listen.c
  228. and
  229. .BR /sys/src/cmd/aux/listen1.c .
  230. The other commands are
  231. .IR rc (1)
  232. scripts in
  233. .BR /rc/bin/service .
  234. .SH "SEE ALSO"
  235. .IR authsrv (6),
  236. .IR dial (2)