Alpine inetd setup

1 post / 0 new
#1 Sat, 2018-02-17 16:41
Mike Sanders
  • Mike Sanders's picture
  • Offline
  • Last seen: 1 month 1 week ago
  • Joined: 2016-01-30

Many thanks to apk packagers for including inted, daily I still use: telnetd, ftpd, httpd, & weekly tftpd.

This post is to help others who may need examples to setup inetd.


1/3 setup...


sudo apk add busybox-extras 
 
sudo vi /etc/inetd.conf
 
sudo vi /etc/httpd.conf


2/3 test....


sudo inetd -f
 
telnet localhost 23
 
# after exiting telnet, ctrl-c (to stop foreground 'inetd -f')


3/3 run inetd at boot....


sudo rc-update add inetd default
 
sudo rc-service inetd start


configuration files....


# inetd.conf (see also /etc/services for protocol aliases)
# be smart - dont enable services unless you need them
 
#qotd stream tcp nowait root /usr/bin/fortune fortune
 
#ftp stream tcp nowait root /usr/sbin/ftpd ftpd -w -a USER-NAME-HERE /www
 
telnet stream tcp nowait root /usr/sbin/telnetd telnetd -i -l /bin/login
 
#tftp dgram udp nowait root /usr/bin/tftp tftpd -c -l /pub
 
#http stream tcp nowait root /usr/sbin/httpd httpd -i -c /etc/httpd.conf -h /www
 
# eof


# httpd.conf - BusyBox v1.00 (2005.04.23-22:18+0000) multi-call binary
# Contribute by Dubravko Penezic, dpenezic <at> gmail.com , 2005-05-15
#
 
#
# Allow/Deny part
#
# [aA]:from    ip address allow, * for wildcard, network subnet allow
# [dD]:from    ip address deny, * for wildcard, network subnet allow
#
# network subnet definition
#  172.20.                    address from 172.20.0.0/16
#  10.0.0.0/25                address from 10.0.0.0-10.0.0.127
#  10.0.0.0/255.255.255.128   address that previous set
#
#  The Deny/Allow IP logic:
#
#  - Default is to allow all.  No addresses are denied unless
#         denied with a D: rule.
#  - Order of Deny/Allow rules is significant
#  - Deny rules take precedence over allow rules.
#  - If a deny all rule (D:*) is used it acts as a catch-all for unmatched
#       addresses.
#  - Specification of Allow all (A:*) is a no-op
#
# Example:
#   1. Allow only specified addresses
#     A:172.20          # Allow any address that begins with 172.20.
#     A:10.10.          # Allow any address that begins with 10.10.
#     A:127.0.0.1       # Allow local loopback connections
#     D:*               # Deny from other IP connections
#
#   2. Only deny specified addresses
#     D:1.2.3.        # deny from 1.2.3.0 - 1.2.3.255
#     D:2.3.4.        # deny from 2.3.4.0 - 2.3.4.255
#     A:*             # (optional line added for clarity)
#
# Note:
# A:*
# D:*
# Mean deny ALL !!!!
#
 
A:*
 
#
# Authentication part
#
# /path:user:pass     username/password
#
# password may be clear text or MD5 cript
#
# Example :
# /cgi-bin:admin:FOO
#
# MD5 crypt password :
# httpd -m "_password_"
# Example :
# httpd -m "astro"  =>  $1$$e6xMPuPW0w8dESCuffefU.
# /work:toor:$1$$e6xMPuPW0w8dESCuffefU.
#
 
#
# MIME type part
#
# .ext:mime/type   new mime type not compiled into httpd
#
# Example :
# .ipk:application/octet-stream
#
# MIME type compiled into httpd
#
# .htm:text/html
# .html:text/html
# .jpg:image/jpeg
# .jpeg:image/jpeg
# .gif:image/gif
# .png:image/png
# .txt:text/plain
# .h:text/plain
# .c:text/plain
# .cc:text/plain
# .cpp:text/plain
# .css:text/css
# .wav:audio/wav
# .avi:video/x-msvideo
# .qt:video/quicktime
# .mov:video/quicktime
# .mpe:video/mpeg
# .mpeg:video/mpeg
# .mid:audio/midi
# .midi:audio/midi
# .mp3:audio/mpeg
 
# Default MIME type is application/octet-stream if extension isnt set
 
# eof