500 OOPS: vsftpd: refusing to run with writable root inside chroot() with vsftpd 2.3.5+

If you encounter this errormessage after a recent update or fresh install with vsftpd 2.3.5 or newer, here is whats happend:

As of vsftpd 2.3.5, the chroot directory that users are locked to must not be writable. This is in order to prevent a security vulnerabilty.

Depending on the configuration you utilize this can be a problem. If so I suggest for the moment to downgrade to 2.3.4 (I’m aware not the best solution!), or change your setup. People with ArchLinux have another solution to this, they can install vsftpd-ext via AUR and then set in the config allow_writable_root=YES. If someone has the patch agains the source for this, I would love to get a copy.

Downloadlinks for 2.3.4

https://security.appspot.com/downloads/vsftpd-2.3.4.tar.gz

https://security.appspot.com/downloads/vsftpd-2.3.4.tar.gz.asc

As soon I find a better solution to this problem, I will write again.

flattr this!

One-Time-Passwords with Google-Authenticator


Today I want to show you how to set up Google-Authenticator so make your remote login more secure then before. It offers us to secure our login with a HOTP (counter-based, HMAC-based OTP) or TOTP (time-based) tokens as an additional challenge before you can login. Basically even IF someone spots your password, without a fresh token he can’t login. But no worries, in case you loose your cell (which is used as our token-generator, supported is iOS, Android and BlackBerry) he also give us 5 extra tokens for emergency’s.

 

A word for those maybe thinking “Urk, its from Google”. Yes it is, BUT its not dependent or require you to have anything from the Google services. It’s a opensource implantation of the known algorithms, and like the WordPress plugin shows, nicely can be integrated into various apps. Also its quite cost-effective as most have anyway a smartphone today.

So let’s start with the installation, I did it on a Ubuntu Lucid 10.04. We need to build it the packages “gcc mercurial libpam0g-dev subversion git-core”. Additional we should install “libqrencode”, but as it’s not available from the repository’s we just build it from the source, so we need also “git” to checkout the source from GitHub. libqrencode is to display a QR code on the terminal, saving us the typing of the initial code for the token generator.

$: sudo apt-get update ; sudo apt-get install -yy gcc mercurial libpam0g-dev git-core subversion

Once we’re done that, lets check the mercurial version as its crucial to checkout the Google-Authenticator source-code. You do that with “hg –version”. If the version is bigger then 1.5 then all is OK but if the version is smaller then that, we need to upgrade it to one bigger then 1.5. To do so, just go to the Ubuntu FTP Server and grab the package “mercurial-common_*.deb” and the “mercurial_*_amd64.deb” or “mercurial_*_i386.deb” depending on your system. Install them with:

$: sudo dpkg -i mercurial*.deb

That takes care of mercurial, lets move on with the preparations. Next we install libqrencode:

$: git clone https://github.com/fukuchi/libqrencode.git
$: cd libqrencode
$: ./autogen.sh
$: ./configure --prefix=/usr
$: make
$: sudo make install

With that libqrencode is in place. We need to install it in /usr instead of /usr/local, cause otherwise google-authenticator won’t find it. On we go with building the pam-module:

$: hg clone https://code.google.com/p/google-authenticator/
$: cd google-authenticator/libpam
$: make
$: sudo make install

Now that the parts are in place we begin assembling them. Each user now must run “google-authenticator” once so he gets a key generated before we can activate it. The program generates a base32-encoded key you are to enter in you smartphone, and also here comes libqrencode into play. It generate us a nice handy QR code to shoot with the phone saving us the typing (yes, it works fine on a console, using ansi). Also you get the 5 emergency codes I mentioned earlier. Put them in a save place! Before we make the final changes and activate the new config, open a additional terminal just in case. It’s for the case that something get wrong, so you can look up whats wrong with your config, and so you still have access to the server. Now it gets time to edit the pam-configuration.

$: sudo nano /etc/pam.d/sshd

Now we have to decide if we want get asked for the token before or after the regular password. That determines if you insert the line “auth required pam_google_authenticator.so” before the or after the default line. In Ubuntu the line for the default auth is for example “@include common-account”. So insert it before or after that line, depending on how you like it better. I get asked for my token before the usual password, so I can anger the brute-force kids a bit. After that we edit the sshd_config to enable Challange-Response-Auth.

$: nano /etc/ssh/sshd_config

Here look for the line “ChallengeResponse no” and change the “no” to a “yes”. Now we’re ready to to restart the sshd, and it (should) work.

$: sudo service ssh restart (or sudo /etc/init.d/ssh restart)

Now try to login, and see if everything works. If not, check “/var/log/auth.log” for error-messages. If you only want to use 2-factor-auth only for a few users, then you find a patch here to disable the 2-factor-auth when there is no .google-authenticator file in the home-folder of the user.

If you should use public-key-auth, its a bit complicated. That comes from the fact that the OpenSSH daemon overrides the pam-config on public-key-auth, and so the token-auth won’t take place. For some of you this might be what you want, but for others wanting to combine both, it might be not what they want. I have a solution in one of my magazines here but I want to play first with it a bit, before I write here in detail about that.

Hope you could find something useful in this article. The applications for the cellphones can be found in the following places:

While looking for more information on the Blackberry client I just found something nice. There is a WordPress plugin that allows you to use this login-method with your blog to raise safety for you admin account. The plugin you can download here.

And for more information/references:

 

flattr this!

ColorHug – A open source display colorimeter

Picture of the ColorHug attached to a screenToday I read in the current issue of the Linux Magazin about a opensource colorimeter named ColorHug. It’s certainly something nice since first of all its opensource and also its noticeable cheaper then professional ones. Another plus point for me is that it works on Linux. Many probably wonder “What the heck is a colorimeter to begin with and why does it bother me?”. Well it’s not too complicated, a colorimeter is a device allowing you to calibrate your monitor so it shows the colors accurate. And why should you care? Since you want to view your pictures/videos even nearer to reality, and also it helps when you edit them. The ICC profile that gets generated by it can be used with Linux (well, to be expected, eh?), Windows and also Mac OSX.

The ColorHug itself is a small accessory with the dimensions 32mm wide, 43mmm tall and 21mm deep. It gets connected via USB. Here are some pictures from ColorHug’s website to illustrate how it looks.

colorhug1-large colorhug4-large colorhug5-large

The ColorHug is a lot faster then similar products and the good point is it’s open design, which allows for example picture or video editing software to integrate it.

Currently you can preorder the ColorHug for just £48 (56,57€ / 74,92$), its a 20% developer discount since the ColorHug probably have some bugs in the beginning. But due its open design and the possibility to upgrade firmware it no problem to fix possible problems later. If you order later the price is supposed to be £60 (70,70€ / 93,65$), so I suggest if you’re intrested, preorder now.

Please be aware that there are no OSX/Windows driver, users not using Linux can use the LiveCD or the Software included in Fedora 16 or later. For ordering and even more information please visit the ColorHug website.

The software and the firmware for ColorHug can be found on https://gitorious.org/colorhug.

flattr this!