Free cookie consent management tool by TermsFeed Policy Generator

/dev/blog/ID10T

Advertisement

SSH: Disable Host Key Checking temporarily

Linux Comments

A couple of days ago I found an easy solution to a problem I ignored way too long. When working with Virtual Servers it’s a common occurence that you test something, it doen’t go as planned and the server doesn’t boot properly anymore. Most VPS providers offer some kind of Recovery OS or a Rescue System for those situations. Just boot the server into this OS, revert your faulty changes, reboot the system and you’re set to nuke your server again.
Sadly, I always had a small problem. As the Recovery OS uses a different SSH Host Key, you get a warning when connecting to the server:

○ → ssh testserver
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
4b:15:69:f9:0d:8d:e8:2e:f6:1d:d8:5a:c0:a2:9c:31.
Please contact your system administrator.
Add correct host key in /home/m3adow/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/m3adow/.ssh/known_hosts:27
  remove with: ssh-keygen -f "/home/m3adow/.ssh/known_hosts" -R testserver.adminswerk.de
RSA host key for testserver.adminswerk.de has changed and you have requested strict checking.
Host key verification failed.

Video: Dockers '--userns-remap' feature explained

Docker Comments

I have been up to the ears in work and in projects, that’s why I haven’t been posting a lot. I initially wanted to create a series about automatic service discovery and configuration with Consul, Registrator and consul-template, but decided to switch to Rancher in the process as I encountered too much hassle and had to make too much workarounds.

But that’s not the topic of this post. I recently created a short video on asciinema to further explain dockers --userns-remap feature which significantly improves security.

What is it you ask? The original description from the docker-daemon manpage:

--userns-remap=default|uid:gid|user:group|user|uid Enable user namespaces for containers on the daemon. Specifying “default” will cause a new user and group to be created to handle UID and GID range remapping for the user namespace mappings used for contained processes. Specifying a user (or uid) and optionally a group (or gid) will cause the daemon to lookup the user and group’s subordinate ID ranges for use as the user namespace mappings for contained processes.

Here’s my video explaining it:

Simplifying Let's Encrypt on Uberspace

Uberspace Comments

I’m regularly using Uberspace, a provider for Shared Hosting with a lot of special quirks (sadly only available in German). I’m also using Let’s Encrypt to create certificates for most of my websites. The hard working folks at Uberspace have integrated a very easy way to apply Let’s Encrypt certificates for your domains, but it’s also very limited:

Übrigens ist dieses Zertifikat für alle oben angegebenen Domains gültig, du bekommst also nicht ein Zertifikat pro Domain, sondern ein Zertifikat, welches für alle Domains gültig ist:

“Your certificate is valid for all entered domains. You don’t get one certificate per domain, but one certificate which can be used for all domains.”

I don’t want this at all. I’ve got several domains set up which are not logically linked, some are not even linked with my name and shall stay this way.

So I created a small script to allow the creation of Let’s Encrypt certificates for several Uberspace domains independently. Introducing letsencrypt-uberspace-mgr.

Windows 10: Fix Reboot instead of Shutdown

Windows Comments

Short tip because I had to spend more time onto it than I wanted. If your Windows 10 often denies a shutdown and reboot instead, check the Power Management setting of your network cards.

Windows 10 Device Manager

Network adapter Power Management

That’s it, your PC should now stay off if you shut it down. It’s possible this setting is reset after updates, so check if the problem resurfaces.

I have no idea why this feature was introduced. From my understanding that’s what the magic packet is for. So if one of my readers knows something about it, feel free to comment.

(via superuser)

Backup Windows partitions as virtual hard disk (VHD)

Windows, Virtualization Comments

Although I prefer Linux as Desktop OS, Gaming on it is still very hard to realize. That’s why I need a Windows installation on my system. Said installation didn’t age well, so I decided to rejuvenate my six year old Windows installation and install Windows 10.

I wanted to have a fresh start and didn’t want to keep anything, but I still wanted to retain my old system and data partition as backup. I decided to use a Virtual Hard Disk (VHD) file as backup format. The advantage of this is that I can easily boot up a VM to compare my old system with my new one. Additionally Windows 7 natively supports mounting VHD, enabling easy access to the files. Thus, I created a step-by-step instruction for later reference.

Prerequisite

Advertisement