[Blogging Intensifies]

Technology, Projects, Linux, Coding, Internet of Things, Music, Books, Life...

  • About

Site News

I Screwed Up

June 10, 2016

So, for a little while now, one of the sites I host on my VPS has had some sort of malware.  I have no idea how it got there but I have ideas about fixing it if I could find it.  There are plenty of sites that will tell you that your website is infected.  There don’t seem to be any that will also tell you “It’s probably in this file here, go look there.”  Instead it’s all “We’ll fix it for a small monthly subscription of $50/month.”

I think I’ll pass on that one.

Instead, I opted to simply rebuild the website from the ground up.  It’s a simple process really, set up a fresh WordPress install, ad the appropriate plug ins, copy the images in the Uploads folder, and do a quick export/import of the database.  I also wanted to make sure I got the permissions right, to avoid any future malware issues, since this was the likely culprit for how the malware got there.

This is where I screwed up.  Instead of doing a CHMOD on the local directory, I mistakenly did a CHMOD on /* -R.  Or in other words, everything in the root directory, Recursively through each directory.  Or in other, other words, “everything”.  It actually failed to run on a bunch of files, likely because they were in use.  It did however break SUDO, which meant I couldn’t easily try to change anything back.  It also immediately killed every website I host since they all use MySQL which could no longer use it’s databases, because it didn’t have permissions.

I don’t host anything major at least.  A couple of personal blogs, my wife’s two blogs, some side projects like TinyTinyRSS.  My main concern were my wife’s blogs, frankly, no one reads my shit at all anymore (why are you here???), lots of people read both of her blogs.

If this were a physical server, I’d load a recovery CD and backup or even just reinstall from there.  This is a VPS though.  There isn’t a physical machine I can access and really, there probably isn’t even a physical machine at all, not a dedicated one.  There may be a dozen other servers on the same physical machine as my VPS.  Fortunately, with the use of a support ticket, Digital ocean will mount a virtual recovery disc to your virtual server.

So I managed to get access to the server files.  I set about with two plans at this point.  Worst case scenario, I would need to reimage the server and rebuild everything.  I’ve done this sort of thing many times over the years moving from server to server, I’m actually pretty good at it.  Getting the data was the important part, so I started some downloads of the data.  Honestly, this was always the only option, but I was hoping I could get the old set up running because it would make my life easier.  If I could get MySQL working I could make proper back ups instead of trying to use the raw files, something I’ve never done (it wasn’t hard in the end).  So, 50,000 files later, I had all of the needed files downloaded.  I probably could have saved some time and just reinstalled the core WordPress files but I wanted to keep things as pain free as possible to avoid any more screw ups.

How to restore the server.  The problems stem from permissions, as in, nothing has permissions on anything.  So the simplest solution seemed to be to set the files all to 777, or open access to every user, group and everything.  This is absolutely horrible practice for a live server and should not be done.  However, I needed ten minutes or so to dump some SQL files and a few other proper back ups that would be much easier in a live environment.

Setting everything to 777 didn’t work, for starters, all those system files that were previously inaccessible, were now accessible, since the recovery CD wasn’t using them.  So now EVERYTHING became 777.  I don’t know much beyond that other than it flat out refused to work at all now.

Fortunately, I had my files, the important stuff.  The next few steps were simple, re-image the server with a clean install, sudo apt-get on apache2, php5, mysql-server, proftpd, ftp the files in the appropriate places.

This is also where I did right on permissions, like I should have done to start with.  Instead of screwing with permissions themselves using CHMOD, I set the appropriate ownership with CHOWN.  This was partially necessary, for example, the files created by MySQL normally own and belong to the mysql user and group.  The ones I restored, were all owned by root.

I also took this opportunity to pair down some of the cruft I’d accumulated.  I kept a copy, but it all doesn’t need to go back.

I feel like the end result worked out well, everything is mostly back on line.  I found later that something had gone wrong in backing up the SQL files for both Joshmiller.net and Blogging Intensifies.  Fortunately there isn’t anything on JoshMiller.net since I had purged it all.  And I don’t post here super often so I only came up missing 2 posts from my last back up, I was able to recover both posts from Google’s Cache pages.  Everything for both The Zippy Zebra and Treasured Tidbits came over though, which was my main concern.

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to email this to a friend (Opens in new window)
Posted in: Linux & Open Source, Site News Tagged: FuckUps, Hosting, Linux, VPS

Welcome to [Blogging Intensifies] .com

July 28, 2015 / Leave a Comment

Welcome to the blog.

BreathingintensifiesCatMemeI have always hated doing these introductory posts but I’m forcing myself to do one anyway.  I always feel like these sort of posts just get buried in the archives and no one cares in the end, but whatever, it’s a place to start.  I’m pretty good at coming up with ideas, I’m pretty good at maintaining those ideas, I’m not so great at the middle part where I need to start the idea and push it out to the world.

So what is [Blogging Intensifies]?  Also to be referred to as [BI] or maybe just BI.  It’s sort of an attempt to start over at Blogging.  I’ve made many such attempts but they all inevitably failed, or just sort of returned to being the crappy mess that made me tired of blogging in the first place.  I’ve run several (read: several dozen, probably more) blogs over the last 15+ years, most of which died off and got folded into another blog.  The most successful was at Lameazoid.com, a blog devoted to video games and toys mostly.

I’ve killed that blog off.

I’m done with it.  Period.  I’ve found my care for it has dropped to nearly zero over the past two or three years, I’ve tried to kill it and revive it a few times, but it feels like an injustice to that legacy.  It’s forcing a dying actor out on stage at gun point when he should be euthanased.

I also have been blogging at Joshmiller.net but that’s always just been my little personal whatever project.

The point is to just start fresh.  No legacy content, no previous expectations, just get back to doing what I enjoy about blogging and writing.

I do plan on keeping somewhat of a focus on topics, but it mostly just comes down to “Technology” and “Technology Adjacent” topics.  I may pull up some old content and post it as new but for the most part I want to keep everything new and fresh.  I also want to try to get back to voicing my opinion on topics, because I feel like lately a lot of my blogging blahs have been due to a loss of voice.  Everything I write has become a sterilized watered down statement instead of a meaningful expressed opinion.

Feel free to leave a comment, feel free to get with me on Twitter @joshmiller, feel free to email me josh@lameazoid.com.

 

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to email this to a friend (Opens in new window)
Posted in: Site News Tagged: introduction, Site News
Twitter LinkedIn email
Instagram Instagram Instagram
GitHub
JoshMiller.net
Lameazoid.com

Categories

  • ►Devices (24)
    • Android (4)
    • PCs (6)
    • Synology NAS (3)
    • Windows Phone (4)
  • ►Lifestyle (17)
    • Books (4)
    • Language (1)
    • Music (10)
  • ►Maker (66)
    • Arduino (8)
    • CHIP (5)
    • ►Coding (26)
      • Advent of Code 2020 (12)
    • Hardware (1)
    • Home Security (2)
    • My DIY Projects (3)
    • Non-Tech (2)
    • Raspberry Pi (9)
    • The Basement (6)
    • The Cloud (3)
  • ►Opinion/Editorial (12)
    • Copyright and You (3)
    • Privacy (3)
    • Social Media (4)
  • ►OS (4)
    • Linux & Open Source (2)
    • Windows (2)
  • Site News (2)
  • ►Technology (6)
    • Security (1)
  • ►What I Use (10)
    • Hardware (3)
    • Photography (2)
    • Software (5)

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 609 other subscribers

Hosted on…


Help support hosting with our referral link!

Copyright © 2021 [Blogging Intensifies].

Me WordPress Theme by themehall.com

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.