.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "NNRPD 8" .TH NNRPD 8 2024-04-01 "INN 2.7.2" "InterNetNews Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME nnrpd \- NNTP server for reader clients .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBnnrpd\fR [\fB\-BDfnoSt\fR] [\fB\-4\fR \fIaddress\fR] [\fB\-6\fR \fIaddress\fR] [\fB\-b\fR \fIaddress\fR] [\fB\-c\fR \fIconfigfile\fR] [\fB\-i\fR \fIinitial\fR] [\fB\-I\fR \fIinstance\fR] [\fB\-p\fR \fIport\fR] [\fB\-P\fR \fIprefork\fR] [\fB\-r\fR \fIreason\fR] [\fB\-s\fR \fIpadding\fR] .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBnnrpd\fR is an NNTP server for newsreaders. It accepts commands on its standard input and responds on its standard output. It is normally invoked by innd(8) with those descriptors attached to a remote client connection. \fBnnrpd\fR also supports running as a standalone daemon. .PP Unlike innd(8), \fBnnrpd\fR supports all NNTP commands for user-oriented reading and posting. \fBnnrpd\fR uses the \fIreaders.conf\fR file to control who is authorized to access the Usenet database. .PP On exit, \fBnnrpd\fR will report usage statistics through syslog(3). .PP \&\fBnnrpd\fR is run from \fBinnd\fR (the default) or from inetd(8), xinetd(8), or some equivalent. As often as not, it is also run as a daemon, with the \fB\-D\fR option, to provide TLS support on a dedicated port. .PP \&\fBnnrpd\fR only reads config files (\fIreaders.conf\fR, \fIinn.conf\fR and \&\fIinn\-secrets.conf\fR) when it is spawned. You can therefore never change the behaviour of a client that's already connected. As a new \fBnnrpd\fR process is spawned for every connection, any changes to these configuration files will be immediately effective for all new connections. There's only one exception: when \fBnnrpd\fR is run as a daemon with the \fB\-D\fR option, any configuration changes in \fIinn.conf\fR won't take effect until \fBnnrpd\fR is restarted. .PP The \fIinn.conf\fR setting \fInnrpdflags\fR can be used to pass any of the options below to instances of \fBnnrpd\fR that are spawned directly from \&\fBinnd\fR. Many options only make sense when \fB\-D\fR is used, so these options should not be used with \fInnrpdflags\fR. See also the discussion of \fInnrpdflags\fR in inn.conf(5). .PP When \fInnrpdloadlimit\fR in \fIinn.conf\fR is not \f(CW\*(C`0\*(C'\fR, it will also reject connections if the load average is greater than that value (typically \&\f(CW\*(C`16\*(C'\fR). \fBnnrpd\fR can also prevent high-volume posters from abusing your resources. See the discussion of exponential backoff in inn.conf(5). .PP \&\fBnnrpd\fR injects articles into the local server running \fBinnd\fR through a UNIX domain socket, or an INET domain socket if not supported. If another server should be used for injection, you can set it with the \fInnrpdposthost\fR parameter in \fIinn.conf\fR. In case authentication credentials are requested during the injection, \fBnnrpd\fR will use the \fIpasswd.nntp\fR file in \fIpathetc\fR. .SH OPTIONS .IX Header "OPTIONS" .IP "\fB\-4\fR \fIaddress\fR" 4 .IX Item "-4 address" The \fB\-4\fR parameter instructs \fBnnrpd\fR to bind to the specified IPv4 address when started as a standalone daemon using the \fB\-D\fR flag. This has to be a valid IPv4 address belonging to an interface of the local host. It can also be \f(CW\*(C`0.0.0.0\*(C'\fR, saying to bind to all addresses (this is the default). .IP "\fB\-6\fR \fIaddress\fR" 4 .IX Item "-6 address" The \fB\-6\fR parameter instructs \fBnnrpd\fR to bind to the specified IPv6 address when started as a standalone daemon using the \fB\-D\fR flag. This has to be a valid IPv6 address belonging to an interface of the local host. It can also be \f(CW\*(C`::0\*(C'\fR, saying to bind to all IPv6 addresses. .Sp By default, \fBnnrpd\fR in daemon mode listens to both IPv4 and IPv6 addresses. With this option, it will listen only to the specified IPv6 addresses. On some systems however, a value of \f(CW\*(C`::0\*(C'\fR will cause it to listen to all IPv4 addresses as well. .IP "\fB\-b\fR \fIaddress\fR" 4 .IX Item "-b address" Similar to the \fB\-4\fR flag. \fB\-b\fR is kept for backwards compatibility. .IP \fB\-B\fR 4 .IX Item "-B" If specified, \fBnnrpd\fR will report login attempts to blacklistd(8) for automatic blocking after a number of failed attempts. To use this flag, the blacklist library must have been found at configure time, or \&\fB\-\-with\-blacklist\fR specified at configure time. For more information, see "BLACKLISTD SUPPORT" below. .IP "\fB\-c\fR \fIconfigfile\fR" 4 .IX Item "-c configfile" By default, \fBnnrpd\fR reads the \fIreaders.conf\fR configuration file to determine how to authenticate connections. The \fB\-c\fR flag specifies an alternate file for this purpose. If the file name isn't fully qualified, it is taken to be relative to \fIpathetc\fR in \fIinn.conf\fR. (This is useful to have several instances of \fBnnrpd\fR running on different ports or IP addresses with different settings.) .IP \fB\-D\fR 4 .IX Item "-D" If specified, this parameter causes \fBnnrpd\fR to operate as a daemon. That is, it detaches itself and runs in the background, forking a process for every connection. By default, \fBnnrpd\fR listens on the NNTP port (119), so either innd(8) has to be started on another port or the \fB\-p\fR parameter used. Note that with this parameter, \fBnnrpd\fR continues running until killed. This means that it reads \fIinn.conf\fR once on startup and never again until restarted. \fBnnrpd\fR should therefore be restarted if \&\fIinn.conf\fR is changed. .Sp When started in daemon mode, \fBnnrpd\fR will write its PID into a file in the \fIpathrun\fR directory. The file will be named \fInnrpd.pid\fR if \fBnnrpd\fR listens on port 119 (default), or \fInnrpd\-%d.pid\fR, where \f(CW\*(C`%d\*(C'\fR is replaced with the port that \fBnnrpd\fR is configured to listen on (\fB\-p\fR option is given and its argument is not \f(CW\*(C`119\*(C'\fR). .Sp You may also want to use \fB\-s\fR when running \fBnnrpd\fR as a daemon. .IP \fB\-f\fR 4 .IX Item "-f" If specified, \fBnnrpd\fR does not detach itself and runs in the foreground when started as a standalone daemon using the \fB\-D\fR flag. .IP "\fB\-i\fR \fIinitial\fR" 4 .IX Item "-i initial" Specify an initial command to \fBnnrpd\fR. When used, \fIinitial\fR is taken as if it were the first command received by \fBnnrpd\fR. After having responded, \fBnnrpd\fR will close the connection. .IP "\fB\-I\fR \fIinstance\fR" 4 .IX Item "-I instance" If specified, \fIinstance\fR is used as an additional static portion within Message-IDs generated by \fBnnrpd\fR, when \fIvirtualhost\fR is set in access groups in \fIreaders.conf\fR; typically this option would be used where a cluster of machines exist with the same virtual hostname and must be disambiguated during posts. .IP \fB\-n\fR 4 .IX Item "-n" The \fB\-n\fR flag turns off resolution of IP addresses to names. If you only use IP-based restrictions in \fIreaders.conf\fR and can handle IP addresses in your logs, using this flag may result in some additional speed. .IP \fB\-o\fR 4 .IX Item "-o" The \fB\-o\fR flag causes all articles to be spooled instead of sending them to innd(8). \fBrnews\fR with the \fB\-U\fR flag should be invoked from cron on a regular basis to take care of these articles. This flag is useful if \fBinnd\fR is accepting articles and \fBnnrpd\fR is started standalone or using inetd(8). .IP "\fB\-p\fR \fIport\fR" 4 .IX Item "-p port" The \fB\-p\fR parameter instructs \fBnnrpd\fR to listen on \fIport\fR when started as a standalone daemon using the \fB\-D\fR flag. .IP "\fB\-P\fR \fIprefork\fR" 4 .IX Item "-P prefork" The \fB\-P\fR parameter instructs \fBnnrpd\fR to prefork \fIprefork\fR children awaiting connections when started as a standalone daemon using the \&\fB\-D\fR flag. .IP "\fB\-r\fR \fIreason\fR" 4 .IX Item "-r reason" If the \fB\-r\fR flag is used, then \fBnnrpd\fR will reject the incoming connection giving \fIreason\fR as the text. This flag is used by innd(8) when it is paused or throttled. \fIreason\fR should be encoded in UTF\-8. .IP "\fB\-s\fR \fIpadding\fR" 4 .IX Item "-s padding" As each command is received from a client, \fBnnrpd\fR tries to change its \&\f(CW\*(C`argv\*(C'\fR array containing the process title so that commands like ps(1) will print out the hostname of the connected client and the command being executed. To get a full display, the \fB\-s\fR flag may be used with a long string as its argument, which will be overwritten when \fBnnrpd\fR changes its title. .Sp When \fBinnd\fR spawns \fBnnrpd\fR, this flag is used with an argument made of 48 spaces. .IP \fB\-S\fR 4 .IX Item "-S" If specified, \fBnnrpd\fR will start a negotiation for a TLS session as soon as connected. To use this flag, the OpenSSL SSL and crypto libraries must have been found at configure time, or \fB\-\-with\-openssl\fR specified at configure time. For more information on running \fBnnrpd\fR with TLS support, see "TLS SUPPORT". .IP \fB\-t\fR 4 .IX Item "-t" If the \fB\-t\fR flag is used, then all client commands and initial responses will be traced by reporting them in syslog. This flag is set by innd(8) under the control of the ctlinnd(8) \f(CW\*(C`trace\*(C'\fR command, and is toggled upon receipt of a SIGHUP; see signal(2). .SH "TLS SUPPORT" .IX Header "TLS SUPPORT" If INN is built with \fB\-\-with\-openssl\fR or if the OpenSSL SSL and crypto libraries are found at configure time, \fBnnrpd\fR will support news reading over TLS (also known as SSL). For clients that use the STARTTLS command, no special configuration is needed beyond creating a TLS/SSL certificate for the server. You should do this in exactly the same way that you would generate a certificate for a web server. .PP If you're happy with a self-signed certificate (which will generate warnings with some news reader clients), you can create and install one in the default path by running \f(CW\*(C`make cert\*(C'\fR after \f(CW\*(C`make install\*(C'\fR when installing INN, or by running the following commands: .PP .Vb 7 \& umask 077 \& openssl req \-new \-x509 \-nodes \-out /cert.pem \e \& \-days 366 \-keyout /key.pem \& chown news:news /cert.pem \& chmod 640 /cert.pem \& chown news:news /key.pem \& chmod 600 /key.pem .Ve .PP Replace the paths with something appropriate to your INN installation. This will create a self-signed certificate that will expire in a year. The \fBopenssl\fR program will ask you a variety of questions about your organization. Enter the fully qualified domain name of your news service (either the server canonical name or a dedicated alias for the news service) as the name the certificate is for. .PP You then have to set these \fIinn.conf\fR parameters with the right paths: .PP .Vb 3 \& tlscapath: \& tlscertfile: /cert.pem \& tlskeyfile: /key.pem .Ve .PP If you want to use a complete certificate chain, you can directly put it in \fItlscertfile\fR (like Apache's \fISSLCertificateFile\fR directive). Alternately, you can put a single certificate in \fItlscertfile\fR and use \&\fItlscafile\fR for additional certificates needed to complete the chain, like a separate authority root certificate. .PP More concretely, when using Let's\ Encrypt certificates, Certbot's files can be installed as follows: .PP .Vb 3 \& tlscapath: /etc/letsencrypt/live/news.server.com \& tlscertfile: /etc/letsencrypt/live/news.server.com/fullchain.pem \& tlskeyfile: /etc/letsencrypt/live/news.server.com/privkey.pem .Ve .PP or: .PP .Vb 4 \& tlscapath: /etc/letsencrypt/live/news.server.com \& tlscafile: /etc/letsencrypt/live/news.server.com/chain.pem \& tlscertfile: /etc/letsencrypt/live/news.server.com/cert.pem \& tlskeyfile: /etc/letsencrypt/live/news.server.com/privkey.pem .Ve .PP Make sure that the permission rights are properly set so that the news user or the news group can read these directories and files (typically, he should access \fI/etc/letsencrypt/live/news.server.com\fR and \&\fI/etc/letsencrypt/archive/news.server.com\fR where the real keys are located, and the private key should not be world-readable). .PP If you prefer to point to files outside the directory of Let's\ Encrypt, you may add a post-renewal hook for Let's\ Encrypt to copy the generated files to another location, and give them the expected rights. .PP There are two common ways for a news client to negotiate a TLS connection: either via the use of a dedicated port (usually 563) on which TLS is immediately negotiated upon connection, or via the now discouraged way (per RFC\ 8143) to use the STARTTLS command on the usual NNTP port (119) to dynamically upgrade from unencrypted to TLS-protected traffic during an NNTP session. \fBinnd\fR does not, however, know how to listen for connections to that separate port (563). You will therefore need to arrange for \fBnnrpd\fR to listen on that port through some other means. This can be done with the \fB\-D\fR flag along with \f(CW\*(C`\-p 563\*(C'\fR and put into your init scripts: .PP .Vb 1 \& su news \-s /bin/sh \-c \*(Aq/nnrpd \-D \-p 563 \-S\*(Aq .Ve .PP but the easiest way is probably to add a line like: .PP .Vb 1 \& nntps stream tcp nowait news /nnrpd nnrpd \-S .Ve .PP to \fI/etc/inetd.conf\fR or the equivalent on your system and let \fBinetd\fR run \fBnnrpd\fR. (Change the path to \fBnnrpd\fR to match your installation.) You may need to replace \f(CW\*(C`nntps\*(C'\fR with \f(CW\*(C`563\*(C'\fR if \f(CW\*(C`nntps\*(C'\fR isn't defined in \&\fI/etc/services\fR on your system. You may also want to use the lowercase \fB\-s\fR flag with a long string as its argument to see more information about incoming connections in ps(1) output. .PP Optionally, you may set the \fItlsciphers\fR, \fItlsciphers13\fR, \&\fItlscompression\fR, \fItlseccurve\fR, \fItlspreferserverciphers\fR, and \&\fItlsprotocols\fR parameters in \fIinn.conf\fR to fine-tune the behaviour of the TLS/SSL negotiation whenever a new attack on the TLS protocol or some supported cipher suite is discovered. .SH "BLACKLISTD SUPPORT" .IX Header "BLACKLISTD SUPPORT" blacklistd(8) is a FreeBSD/NetBSD daemon for preventing brute force attacks by blocking attackers after a number of failed login attempts. When \fBnnrpd\fR is built with blacklistd support, it will report login attempts to the blacklistd daemon for potential blocking. .PP Adding the configuration below to \fI/etc/blacklistd.conf\fR under the \f(CW\*(C`[local]\*(C'\fR section, assuming \fBnnrpd\fR is listening on port 563, would lead to attackers being blocked for 10 minutes after 5 failed login attempts. .PP .Vb 2 \& # adr/mask:port type proto owner name nfail disable \& 563 stream * * * 5 10m .Ve .PP See the blacklistd(8) documentation for more information. .SH "PROTOCOL DIFFERENCES" .IX Header "PROTOCOL DIFFERENCES" \&\fBnnrpd\fR implements the NNTP commands defined in RFC\ 3977 (NNTP), RFC\ 4642 updated by RFC\ 8143 (TLS/NNTP), RFC\ 4643 (NNTP authentication), RFC\ 6048 (NNTP LIST additions) and RFC\ 8054 (NNTP compression) with the following differences: .IP 1. 4 The XGTITLE [\fIwildmat\fR] command is provided. This extension is used by ANU-News and documented in RFC\ 2980. It returns a \f(CW\*(C`282\*(C'\fR reply code, followed by a one-line description of all newsgroups that match the pattern. The default is the current group. .Sp Note that LIST NEWSGROUPS should be used instead of XGTITLE. .IP 2. 4 The XHDR \fIheader\fR [\fImessage-ID\fR|\fIrange\fR] command is implemented. It returns a \f(CW\*(C`221\*(C'\fR reply code, followed by specific header fields for the specified range; the default is to return the data for the current article. See RFC\ 2980. .Sp Note that HDR should be used instead of XHDR. .IP 3. 4 The XOVER [\fIrange\fR] command is provided. It returns a \f(CW\*(C`224\*(C'\fR reply code, followed by the overview data for the specified range; the default is to return the data for the current article. See RFC\ 2980. .Sp Note that OVER should be used instead of XOVER. .IP 4. 4 A new command, XPAT \fIheader\fR \fImessage-ID\fR|\fIrange\fR \fIpattern\fR [\fIpattern\fR ...], is provided. The first argument is the case-insensitive name of the header field to be searched. The second argument is either an article range or a single message-ID, as specified in RFC\ 2980. The third argument is a \fIuwildmat\fR\-style pattern; if there are additional arguments, they are joined together separated by a single space to form the complete pattern. This command is similar to the XHDR command. It returns a \f(CW\*(C`221\*(C'\fR response code, followed by the text response of all article numbers that match the pattern. .IP 5. 4 A newsgroup name is case-sensitive for \fBnnrpd\fR. .IP 6. 4 If IHAVE has been advertised, it will not necessarily be advertised for the entire session (contrary to section 3.4.1 of RFC\ 3977). \fBnnrpd\fR only advertises the IHAVE capability when it is really available. .IP 7. 4 \&\fBnnrpd\fR allows a wider syntax for wildmats and ranges (especially \f(CW\*(C`\-\*(C'\fR and \f(CW\*(C`\-\fR\f(CIarticle\-number\fR\f(CW\*(C'\fR). .IP 8. 4 When keyword generation is used, an experimental feature enabled with the \&\fIkeywords\fR parameter in \fIinn.conf\fR, \f(CW\*(C`Keywords:full\*(C'\fR is advertised in LIST OVERVIEW.FMT even though overview information is computed and does not necessarily come from Keywords header fields. .SH HISTORY .IX Header "HISTORY" Written by Rich $alz for InterNetNews. Overview support added by Rob Robertston and Rich in January, 1993. Exponential backoff (for posting) added by Dave Hayes in Febuary 1998. .SH "SEE ALSO" .IX Header "SEE ALSO" blacklistd(8), ctlinnd(8), innd(8), inn.conf(5), inn\-secrets.conf(5), libinn_uwildmat(3), nnrpd.track(5), passwd.nntp(5), readers.conf(5), signal(2).