So, today I tried to get an email server working on Centos7. All was going well and according to plan.
I edited a few config files here and there and thought, “I know, I’ll reset the box.”
Big mistake. I got locked out. Not bricked. Just locked out.
What I have also come to discover is that:
- My VPS host has a Java console that doesn’t work.
- That NetworkManager or rsyslog breaks things.
To the first one, yes, my new super fast VPS host (I’ll refrain from using their name) has a great web console system where you can log in. There’s only 1 problem. Both on Mac and PC, it fails to log in through the browser – even though I have the latest versions of Java as per their recommendation.
Fortunately, they provided the raw login credential details, so I could actually still get in via an ssh session.
After about 3 hours of going in circles and following up on edits and backtracking what I’d actually done before, I discovered that my DNS nameserver settings were basically turned to nothing.
Yes, my /etc/resolv.conf file was pretty much destroyed and missing things. The ‘nameservers’ configs were commented out!!!
These two lines being commented out prevented me from being able to connect to the server, and also, from the server being able to connect to the outside world.
All I can put it down to was installation of rsyslog or the NetworkManager. (nmtui)
So now, it looks a little more like this:
search my-servername.com DNS1=22.214.171.124 DNS2=126.96.36.199 DOMAIN=localdomain nameserver XX.XX.XX.XX nameserver XX.XX.XX.XX
Note: the nameserver XXs represent an IP.
Then, once I could ping google again, I basically wiped the IPTable firewall rules to make sure. I have written this so that others may be aware of this problem.
Be careful of what you install.
As a side note, do yourself a favour and install midnight commander. It’s a bit like xtree gold for linux, and is easy to use. (https://www.youtube.com/watch?v=YKjMmSuOELQ)
yum install mc
Now to set the firewall rules back up and continue with the mail server…