DNS/Bind9 - Installation and configuration

Description: Need to install DNS on server with the following configuration: It must respond authoritatively to all non-recursive queries for names in the zones it is authoritative for. It must respond to all recursive queries from the hosts on its own network. It must not respond to any recursive queries from any outside host (i.e. host not on its own network). Apart from the queries in (1), it should not respond to any queries from any outside host. It must contain valid zone data for its zone(s). The cache parameters must be chosen sensibly It must not be susceptible to the standard cache poisoning attacks. See http://www.kb.cert.org/vuls/id/800113 for details. Test its DNS server using porttest.dns-oarc.net (see http://www.dns-oarc.net/oarc/services/porttest). It should have the following normal zone: ...

September 26, 2015  |  🏷️Dns 🏷️Bind

Install Quagga configure with RIP

Description: Install quagga on gw and configure it so traffic can be forwarded between internet and the virtual LAN Implementation: Enable ip-forwarding: In /etc/sysctl.conf: Uncomment net.ipv4.ip_forward=1 Restart gw Installation: Run aptitude Locate and install metapackage quagga Configuration: In /etc/quagga/daemons, set the following: zebra=yes ripd=yes Create /etc/quagga/zebra.conf (owned by quagga:quagga, mode 640): hostname gw.d4.sysinst.ida.liu.se password read_password enable password write_password log file /var/log/quagga/zebra.log ip forwarding ipv6 forwarding Create /etc/quagga/ripd.conf (owned by quagga:quagga, mode 640): hostname gw.d4.sysinst.ida.liu.se password read_password enable password write_password log file /var/log/quagga/ripd.conf router rip version 2 network eth1 route 130.236.179.88/29 ! Start: service quagga start ...

Example smb.conf

# This is the main Samba configuration file. You should read the # smb.conf(5) manual page in order to understand the options listed # here. Samba has a huge number of configurable options (perhaps too # many!) most of which are not shown in this example # # Any line which starts with a ; (semi-colon) or a # (hash) # is a comment and is ignored. In this example we will use a # # for commentry and a ; for parts of the config file that you # may wish to enable # # NOTE: Whenever you modify this file you should run the command "testparm" # to check that you have not made any basic syntactic errors. # #======================= Global Settings ===================================== [global] netbios name = David workgroup = WORKGROUP server string = David wins support = true dns proxy = no hosts allow = 192.168.1. security = user map to guest = Bad User default service = global #server signing = mandatory ; Doesn't seem to work on OSX #log level = 2 log file = /var/log/samba/%m.log max log size = 50 public = yes available = yes browseable = yes only guest = yes read only = yes ; Disable printers load printers = no printing = bsd printcap name = /dev/null show add printer wizard = no disable spoolss = yes #============================ Share Definitions ============================== [ftp] comment = Public Stuff path = /var/ftp/public read only = no directory mask = 5777 create mask = 5677

April 27, 2015  |  🏷️Samba 🏷️Cifs

Installing Teamspeak3 Server

Download tarball from www.teamspeak.com Untar to /home/teamspeak Add user/group teamspeak Run the init as teamspeak sudo su - teamspeak ./ts3server_minimal_runscript.sh createinifile=1 Configure ts3server.ini Make sure you can start it (then ^C to kill it) ./ts3server_startscript.sh start Create /etc/systemd/system/teamspeak.service [Unit] Description=Teamspeak server After=network.target [Service] User=teamspeak Group=teamspeak Type=forking PIDFile=/home/teamspeak/ts3server.pid ExecStart=/home/teamspeak/ts3server_startscript.sh start [Install] WantedBy=multi-user.target Test it through systemctl and then enable it sudo systemctl start teamspeak.service sudo systemctl enable teamspeak.service

March 21, 2015  |  🏷️Systemd

Activating SMTP AUTH (PLAIN) through STARTTLS in sendmail (FreeBSD)

N.B. This expects a working sendmail installation with STARTTLS Install cyrus-sasl # install cyrus-sasl2 cd /usr/ports/security/cyrus-sasl2 make install clean echo "pwcheck_method: saslauthd" > /usr/local/lib/sasl2/Sendmail.conf # install cyrus-sasl2-saslauthd cd /usr/ports/security/cyrus-sasl2-saslauthd make install clean echo 'saslauthd_enable="YES"' >> /etc/rc.conf service saslauthd start Set sendmail make flags Set the following flags in /etc/make.conf (create if it doesn’t exist) SENDMAIL_CFLAGS=-I/usr/local/include/sasl -DSASL SENDMAIL_LDFLAGS=-L/usr/local/lib SENDMAIL_LDADD=-lsasl2 Recompile sendmail Did you have the source in /usr/src? Otherwise you will need to run the following command. If you don’t use RELEASE-10, you should change that. ...

Sendmail / Postfix - Testing mailserver

Links qmail.jms1.net BSD Handbook Sendmail.org This expects you to have netcat, perl and openssl installed Hello without TLS nc mail.server.com 25 220 mail.server.com ESMTP Sendmail 8.14.7/8.14.7; Thu, 11 Sep 2014 12:01:22 +0200 (CEST) > ehlo friendly.server.com 250-mail.server.com Hello friendly [1.2.3.4], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-AUTH DIGEST-MD5 CRAM-MD5 250-STARTTLS 250-DELIVERBY 250 HELP > quit< 221 2.0.0 mail.server.com closing connection Hello with TLS openssl s_client -starttls smtp -crlf -connect mail.server.com:25 # ...Loads of text here... > ehlo friendly.server.com # ... Same as login without TLS (above) ... Test login $ perl -MMIME::Base64 -e 'print encode_base64("\000coolname\@iix.se\000my-password")' AGNvb2xuYW1lQGlpeC5zZQBteS1wYXNzd29yZA== # .. Log in to server with one of the above ... > AUTH PLAIN AGNvb2xuYW1lQGlpeC5zZQBteS1wYXNzd29yZA== 235 2.0.0 OK Authenticated > quit 221 2.0.0 mail.server.com closing connection Sending mail > mail from: <[email protected]> 250 ok > rcpt to: <[email protected]> 250 ok > data 354 go ahead > From: John <[email protected]> > To: Nobody <[email protected]> > Subject: fnord > > hail eris! > . 250 ok 1113954693 qp 29052 > quit

Example of OpenBSD Postfix main.cf

# Global Postfix configuration file. This file lists only a subset # of all parameters. For the syntax, and for a complete parameter # list, see the postconf(5) manual page (command: "man 5 postconf"). # # For common configuration examples, see BASIC_CONFIGURATION_README # and STANDARD_CONFIGURATION_README. To find these documents, use # the command "postconf html_directory readme_directory", or go to # http://www.postfix.org/BASIC_CONFIGURATION_README.html etc. # # For best results, change no more than 2-3 parameters at a time, # and test if Postfix still works after every change. # Where is the postfix queue? queue_directory = /var/spool/postfix # Where are postXXX commands? command_directory = /usr/bin # Where are the postfix daemons? daemon_directory = /usr/lib/postfix/bin # Where is postfix-writeable data? data_directory = /var/lib/postfix # Who to run postfix as? mail_owner = postfix # What's my FQDN? myhostname = phii.iix.se # What's my domain name? mydomain = iix.se # Where are my mail sent from? myorigin = $mydomain # Which interfaces to I listen on? inet_interfaces = all # I think this is to which target's I email? mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain # How I reject mail (550 = reject mail, 450 = try again later) unknown_local_recipient_reject_code = 550 # Who do I trust? (I think this is forwarding or something) mynetworks_style = host # If you change the alias database, run "postalias /etc/aliases" (or # wherever your system stores the mail alias file), or simply run # "newaliases" to build the necessary DBM or DB file. # # It will take a minute or so before changes become visible. Use # "postfix reload" to eliminate the delay. alias_maps = hash:/etc/postfix/aliases # The alias_database parameter specifies the alias database(s) that # are built with "newaliases" or "sendmail -bi". This is a separate # configuration parameter, because alias_maps (see above) may specify # tables that are not necessarily all under control by Postfix. # What does this mean? Your guess is as good as mine alias_database = $alias_maps # Allow email tags # See canonical(5) local(8), relocated(5) and virtual(5) for effects recipient_delimiter = + # Debug level debug_peer_level = 2 # The debugger_command specifies the external command that is executed # when a Postfix daemon program is run with the -D option. # # Use "command .. & sleep 5" so that the debugger can attach before # the process marches on. If you use an X-based debugger, be sure to # set up your XAUTHORITY environment variable before starting Postfix. # debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 # If you can't use X, use this to capture the call stack when a # daemon crashes. The result is in a file in the configuration # directory, and is named after the process name and the process ID. # # debugger_command = # PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont; # echo where) | gdb $daemon_directory/$process_name $process_id 2>&1 # >$config_directory/$process_name.$process_id.log & sleep 5 # # The full pathname of the Postfix sendmail command. sendmail_path = /usr/bin/sendmail # The full pathname of the Postfix newaliases command. newaliases_path = /usr/bin/newaliases # The full pathname of the Postfix mailq command. mailq_path = /usr/bin/mailq # setgid_group: The group for mail submission and queue management # commands. This must be a group name with a numerical group ID that # is not shared with other accounts, not even with the Postfix account. # setgid_group = postdrop # html_directory: The location of the Postfix HTML documentation. html_directory = no # manpage_directory: The location of the Postfix on-line manual pages. manpage_directory = /usr/share/man # sample_directory: The location of the Postfix sample configuration files. # This parameter is obsolete as of Postfix 2.1. but it feels nice to keep it sample_directory = /etc/postfix/sample # readme_directory: The location of the Postfix README files. readme_directory = /usr/share/doc/postfix # Protocol to use (I only have ipv4 so I can deploy it everywhere) inet_protocols = ipv4 ## Make sure we look in /etc/hosts first lmtp_host_lookup = native smtp_host_lookup = native # Fix issue with smtpd not finding certs smtpd_tls_CAfile = /etc/ssl/certs/ca-certificates.crt smtpd_tls_cert_file = /etc/postfix/ssl/newcert.pem smtpd_tls_key_file = /etc/postfix/ssl/privkey.key # Do I still need this? Yes? No? Maybe? compatibility_level = 2

December 30, 2013  |  🏷️Postfix