title: Linux Server Applications breadcrumbs:
{:.no_toc}
Outdated and missing information
apt install apache2
Update security.conf
:
ServerTokens Prod
ServerSignature Off
a2<en|dis><conf|mod|site> <...>
apache2ctl
Sends an emails when APT updates are available.
apt install apticron
/etc/apticron/apticron.conf
cp /usr/lib/apticron/apticron.conf /etc/apticron/apticron.conf
/etc/cron.d/apticron
(e.g. 30 23 * * *
).apticron
Possibly outdated
awscli
through pip3chmod +x /usr/local/bin/aws
aws configure [--profile <profile>]
eu-west-2
json
aws s3 cp <local_file> s3://<bucket>/
A free community backend for Bitwarden.
TODO
See Storage: Ceph.
apt install certbot
/etc/letsencrypt/cli.ini
, add renew-hook = systemctl reload nginx
or equivalent.certbot -d <domain> --preferred-challenges=http --webroot --webroot-path=<webroot> certonly
certbot -d <domain> --preferred-challenges=dns --manual certonly
certbot renew --dry-run [--staging]
certbot revoke --cert-path <cert>
Use cloudflare-ddns-updater.sh.
fail2ban
.fail2ban-client status [sshd]
.isdct <verb> [options] [targets] [properties]
isdct show -intelssd
isdct show -all -intelssd [target]
isdct show -sensor
isdct load -intelssd <target>
isdct set -intelssd <target> PhysicalSectorSize=<512|4096>
isdct start -intelssd <target> -standby
isdct show -a -intelssd [target] | grep -i speed
isdct set -intelssd <target> PhySpeed=6
isdct delete -intelssd <target>
isdct set -intelssd <target> PhysicalSectorSize=<512|4096>
isdct set -intelssd <target> MaximumLBA=<size>
isdct set -system EnableLSIAdapter=true
.
It will add another "version" of the SSDs, which you can try again with.x%
) or in gigabytes (xGB
).
Use "native" unless you have a reason not to.isdct start -intelssd <target> -standby
Possibly outdated
This setup requires pubkey plus MFA (if configured) plus password.
apt install libpam-google-authenticator
/etc/pam.d/sshd
, add auth required pam_google_authenticator.so nullok
after @include common-auth
.In /etc/ssh/sshd_config
, set:
ChallengeResponseAuthentication yes
UsePAM yes
AuthenticationMethods publickey,keyboard-interactive
Restart sshd
and check that you can login with pubkey and MFA now.
(Optional) Add my google-auth-config-prompter.sh profile script to /etc/profile.d/
to ask user to configure Google Auth on login.
To allow a group to use only pubkey (no password or OTP):
/etc/ssh/sshd_config
, add Match Group no-mfa
containing AuthenticationMethods publickey
(indented) at the bottom.no-mfa
and add special users to it.To manually configure MFA for a user:
google-authenticator -tduW
isc-dhcp-server
./etc/dhcp/dhcpd.conf
/etc/dhcp/dhcpd6.conf
authorative
statement in subnet declarations so that the server will reply with DHCPNAK for misconfigured clients.
This may significantly reduce reconfiguration delay when a client moves between subnets.range6
, prefer using CIDR notation.
If using range notation, try to align the start and end on a CIDR block to avoid excessive memory usage./116
gives 8191 addresses.The instructions below use NFSv4 without Kerberos. This is not considered secure at all and should only be used on trusted networks and systems.
apt install nfs-kernel-server portmap
cat /proc/fs/nfsd/versions
(Recommended) Enable only v4:
In /etc/default/nfs-common
, set:
NEED_STATD="no"
NEED_IDMAPD="yes"
In /etc/default/nfs-kernel-server
, set:
RPCNFSDOPTS="-N 2 -N 3"
RPCMOUNTDOPTS="--manage-gids -N 2 -N 3"
Mask "rpcbind":
systemctl mask rpcbind.service
systemctl mask rpcbind.socket
mkdir /export
/mnt/zfspool /srv/nfs4/music none bind,defaults,nofail,x-systemd.requires=zfs-mount.service 0 0
/etc/exports
.
fsid=root
.exports(5)
.exportfs -ra
systemctl restart nfs-server
exportfs -v
apt install nfs-common
mount -t nfs4 <server-hostname>:<export> <mountpoint>
ntopng
.ntopng
is enabled and running.chown nobody:nogroup /var/log/ntopng
/etc/ntopng.conf
.-W=<new_port>
to enable HTTPS.-w=0
to disable HTTP.systemd-timesyncd
.ntp
./etc/ntp.conf
, replace existing servers/pools with ntp.justervesenet.no
with the iburst
option.ntpq -pn
(it may take a minute to synchronize).-noout -text
prints the data as formatted text instead of raw Base64.docker logs pihole 2>&1 | grep "random password"
/etc/pihole/adlists.list
./etc/pihole/whitelist.txt
.pihole -g
to update lists.postfix libsasl2-modules mailutils
/etc/postfix/main.cf
./etc/aliases
, then run newaliases
.main.cf
config (example not provided here).
inet_interfaces = loopback-only
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
smtpd_banner = $myhostname ESMTP
apikey
.To
and From
fields, which is typically from root to root.smtp_header_checks
in the main config.postmap -fq "From: root@$(hostname --fqdn)" regexp:smtp_header_checks
/etc/postfix/sasl_passwd
[relay_domain]:port user@domain:password
postmap sasl_passwd
chmod 600 sasl_passwd*
postfix
.echo "Test from $(hostname) at time $(date)." | mail -s "Test" root
File smtp_header_checks
:
/^From:\s*.*\S+@node\.example\.bet.*.*$/ REPLACE From: "Node" <node@example.net>
/^To:\s*.*\S+@node\.example\.net.*$/ REPLACE To: "Someone" <someone@example.net>
echo "Test from $HOSTNAME at time $(date)." | mail -s "Test" root
postconf > /dev/null
postconf -n
mailq
tells you mails are stuck in the mail queue because of previous errors, run postqueue -f
to flush them.TODO
Logs are located in /app/storage/logs/laravel/
inside the container.
unzip
.{ "dns": ["1.1.1.1", "1.0.0.1", "2606:4700:4700::1111", "2606:4700:4700::1001"] }
to /etc/docker/daemon.json
.See Counter-Strike: Global Offensive (CS:GO).
radvd
./etc/radvd.conf
apt install samba
systemctl disable --now nmbd
and systemctl mask nmbd
server signing
and smb encrypt
) on important volumes.socket options = TCP_NODELAY SO_KEEPALIVE IPTOS_LOWDELAY
smb encrypt = disabled
read raw = yes
and read raw = yes
use sendfile = yes
min receivefile size = 16384
aio read size = 16384
and aio write size = 16384
/etc/samba/smb.conf
testparm -t
systemctl restart smbd
useradd -r <name>
useradd
smbpasswd -a <user>
sudo pdbedit -L -v
apt install cifs-utils
Add permanent share:
Create a credentials file (/root/.credentials/smb/<whatever>
):
user=<user>
password=<password>
In /etc/fstab
, add: //<share> <mountpoint> cifs vers=3.1.1,uid=<uid>,gid=<gid>,credentials=<file>,iocharset=utf8 0 0
Test it: mount -a
tftpd-hpa
./etc/default/tftpd-hpa
based on the config below./var/tftp
with permissions 777
and user-group pair tftp:tftp
.File /etc/default/tftpd-hpa
:
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--create --secure"
apt install unbound dns-root-data
/etc/unbound/unbound.conf
/etc/hosts
contains the short and FQDN hostnames./etc/resolv.conf
.DNSStubListener=no
.DNS=::1
.systemd-resolved
./etc/resolv.conf
.Set:
nameserver 127.0.0.1
nameserver ::1
domain <domain>
search <domain-list>
systemctl restart unbound
drill sigfail.verteiltesysteme.net
should give an rcode of SERVFAIL
.drill sigok.verteiltesysteme.net
should give an rcode of NOERROR
./usr/share/dns/root.hints
.See Ubiquiti UniFi Controller (Debian).
See Storage: ZFS.
{% include footer.md %}