My previous article on resetting a Mac OS X password using single user mode is by far the most popular post i’ve ever made. That is to say, people actually go there intentionally. Unfortunately, that post was made in 2008 and is just a little out of date. For example, it talks about 10.4. So, in an effort to induce hapless victims to visit once again, i’m doing an updated post for Lion (10.7) and now Mountain Lion (10.8).
In my previous post I included a last ditch effort involving wiping out the user database completely and allowing the Mac OS X setup assistant to run again and create a user. I’m going to skip that. If you wish, my previous post is still available and, to my knowledge, you can still reset the user database that way. This post will be about resetting an existing user’s password.
So much for the whole “updating more often thing”. Oh well. Anyhow, here is a long overdue list of updates i’ve made to the site recently.
- IPv6 Enabled. This site is completely accessible over pure IPv6 courtesy of Hurricane Electric.
- SSL Enabled. This site now enforces an SSL connection whenever you visit. Completely secure, proxy proof, cache proof, and stuff.
- EC2 hosted. All these improvements are made possible by the fact that the site is now hosted as an Amazon EC2 instance. Same price (or cheaper) as a VPS with 10 billion times the flexibility and performance.
- Up-to-date WordPress. Remember Code Red? Nimbda? Stuxnet? This site no longer hosts them as wordpress is now up-to-date! (btw, i was never actually infected)
- Self-hosted DNS. I now host my own dns again and make changes, etc. whenever I want.
- Namecheap Registered. I am no longer registered with that evil, lying, evil, manipulative, evil, fraudulent company GoDaddy. I switched to Namecheap and haven’t looked back.
All these changes happened back in January, i’ve just forgotten to talk about them. I may talk more about these later and about all the features that I forgot about.
Short post today, trying to post more often.
Ever had a folder full of files? Universally, the answer to that is yes. But, have you ever wanted to mass rename the files according to a pattern? I had such a need today. I had a poorly thought out backup script for my sql files. I had named them all by date in the pattern mm.dd.yy.tar.gz. That works just fine for a year but after that, they don’t sort well. You end up with something like below.
See the problem? Its not sorted properly when you get a folder listing. Makes it difficult to determine which backups you actually have. So, I wrote a little regex to rename them all. I matched the first four digits ($1) the last set of digits ($2) and the rest of the file ($3). Then I rename it in the form 20$2.$1.$3. This has the effect of placing the year at the beginning of the file like i should’ve done to begin with.
rename -v 's/(\d\d\.\d\d)\.(\d\d)\.(.+)$/20$2\.$1\.$3/' *.gz
That one little command instantly renamed 731 files saving me an enormous amount of time and effort. Knowing regular expressions has been a very useful skill. I strongly encourage anyone interested to visit regular-expressions.info.
So, i’m alive. I know I don’t post as often as I should. And I know you probably feel left out, alone, bereft. Fear not, I am back.
Logging Attempted Passwords With SSH
Anyway, remember that post I made of ssh attempts way back when? Well, I got bored. I decided it wasn’t enough to see the usernames attempted, I needed to see the passwords attempted as well. My first thought was to use one of the honeypot ssh servers that exist and simply run the real ssh on another port. I didn’t like that approach. For one thing, I don’t want the attacker to actually make it in, not even to a fake environment.
Read more »