Sunday, September 1, 2019

Deepthot Project Status

Things that need doing

So I left for awhile.  I've had 2 hard drive failures taking out my media server and my main internet box.  Everything is dead.  None of the stuff I have listed as working is in fact working anymore.  I've decided to throw up my hands and start over from scratch.  I'm going to publish this blog and start another.
  1. freeipa - winner although it has been a pain to get working
  2. ldap
  3. dns
  4. home directories
  5. establish network
    1. dhcp
    2. upnp
  6. services
    1. email
      1. exim
      2. imap
      3. mailing lists
      4. spamassassin
    2. media
      1. torrent
      2. plex
    3. web
    4. ssh
      • yubikey
      • external
    1. news
    2. social
      1. mastodon
      2. freenet
      3. diaspora
Do not install heimdal-clients it uninstalls freeipa fucking you up royally

Router

The NAT stuff is kinda a pain on my mikrotik.  But setting up NAT is from ip->firewall->nat  Remember src-nat is outgoing dst-nat is incoming.   Also annoyingly you have to know the IP, so you'll need to set up the dhcp with the IP hard wired.

DNS

*finally* I've been trying for days to get dhcp and dns to play nicely.  The breakthrough was a couple of things.
  • Make sure your permissions are correct on the key file.
    include "/etc/bind/rndc.key"; needs to be readable by both dhcp and dns.  And that belongs in the named.conf file.  freeipa isn't enough.
  • The update permission is in the zone configuration of the dns zones.  This is the magic config that makes it work:
    grant rndc-key zonesub;
  • Don't be afraid to dump the leases on dhcp.  To do that you:
    1. systemctl stop isc-dhcp-server
    2. rm  /var/lib/dhcp/dhcpd.leases
    3. touch /var/lib/dhcp/dhcpd.leases
    4. chown dhcpd /var/lib/dhcp/dhcpd.leases
I hope this is right and sufficient.  I really need to be better about taking notes.  Of course that's why I'm doing the blog.

Adding a client to freeipa

  • apt install -y freeipa-client sssd-tools autofs nfs-kernel-server
  • ipa-client-install
  • ipa service-add nfs/<client>.deepthot.int
  • ipa-getkeytab -s services.deepthot.int -p nfs/<client>.deepthot.int -k /etc/krb5.keytab
  • ipa-client-automount
  • echo automount:  files sss >>/etc/nsswitch.conf
  • edit /etc/nsswitch.conf and put the sss first (there should be a better way)

Snapshots

  1. mount /dev/sda2 /mnt # mount root of btrfs on /mnt
  2. mkdir /mnt/snapshots
  3. btrfs subvolume snapshot -r @ snapshots/whatever
    @ is the root file system's subvolume.  This makes a read-only subvolume that is the state of the filesystem when the snapshot is taken.  You could snapshot anything actually like @/etc to save just the etc before you do something unwise
Easy peasy.  Rollback is a bit tougher
  1. mount /dev/sda2 /mnt
  2. cd /mnt
  3. mv @ to @.bak
  4. btrfs subvolume snapshot snapshots/whatever @
Notice this is missing the -r that makes a read/write snapshot.  If you'd made the original read-write you could have just moved the snapshot to @
I haven't tried this yet, but you probably would have to do a mount -o remount,rw / or something similar.  Maybe a reboot to be safe.

DHCP

Since I set up a second IPA server I thought it would be good to make the dhcp redundant as well.  https://kb.isc.org/docs/aa-00502 is what I'm going to follow.
After a bunch of grief due to me not paying close attention to the configuration (the peer ports change as well as the peer names) I got it working.  Seems to work okayish.

TODO

Okay, the next thing I'm going to do is bite the bullet and set up the home directories.  They're almost there.  One thing though, I want my laptop to be on the network when it's there, but still allow me to log in with a *different* home directory when I'm not on deepthot.  That is I think my next thing.
Derp, no the first thing I need to do is to figure out what the deal is with the keysync on services.  It crashes every minute and fiik why. (actually I just cloned the original and made a redundant server.  I'm planning on reinstalling the old one)
There's still an issue with dhcp, it's requesting x.deepthot.int.deepthot.int be put in, actually it seems to only be fs.  I'm thinking maybe remove it from the kerberos group and re-add it. the issue is dhcp asks for the hostname not the short hostname, if you do what the docs say and set the hostname to include the domain that screws up the dhcp/dns.  So, just use the short one, but make sure the domainname is set right preferably with dhcp working right.

No comments:

Post a Comment