Sunday, November 24, 2013

SSH/SFTP login without password

I just finished setting up password-less login for SSH and SFTP, suing public key authentication. This is something I've been meaning to do for some time, but I could never seem to get around to it. Now though, it's done, and I thought I'd share some of my troubles, and, of course, the solutions to them.

I started by generating the SSH key-pair and transferring the public key to the server. This is quite simple, so I won't go into details, except to provide a link to the ArchWiki article I used as reference.

Next, edit the file /etc/ssh/sshd_config on the server side, and make sure that PubkeyAuthentication is set to Yes.

If you want to make things even more secure, you might want to think about disabling password login completely. Just remember, if you do that, and you loose you private key file, you won't be able to access the server remotely anymore.

After a restart of the ssh daemon on the server, it should now be possible to login without being prompted for a password. This was not the case however...

The problem turns out to be that SSH is a bit cranky when it comes to file permissions. After a fair bit of googling, it turns out that not only does this apply to the authorized_keys files, and the .ssh directory, but also to the $home directory used (this last one caused me a bit of trouble).

Here are the commands for setting the correct file permissions:

chmod go-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
 Once this was done, I was able to access the server without providing a password, both for SSH and SFTP.

Yeay, no more Samba for me!



Sunday, November 10, 2013

Tosca Cake

This isn't really the "traditional" tosca cake, but I prefer this version. It's a basic sponge cake, with an almond toffee on top. The toffee provides a nice bit of extra flavor and crunch.

Tosca Cake




















Ingredients - Cake
150g Butter
2 dl Sugar
2 Eggs
2 tsp Vanilla powder
½ dl Water
3 dl Flour
1 tsp Baking powder

Ingredients - Cake




















Ingredients - Toffee
1 dl Almonds
1 dl Sugar
50g Butter
2 tbsp Flour
2 tbsp Milk

Ingredients - Toffee




















Start by making the cake. Whisk the butter and sugar until completely incorporated. Whisk in the eggs, one at a time. Add the vanilla powder and water and whisk. Mix the flour and baking powder together, and stir it into the batter.
Butter and breadcrumb a mold, the one I use has a diameter of 24cm. Put the batter into the mold and spread it out somewhat evenly.
Bake in the lower part of the oven, at 175°C, for 30 minutes.
In the mean time, prepare the almond toffee. Chop the almonds, then put all the ingredients into a pot, and bring to the boil while whisking. Try to time it so that it's done not too long before the cake is done.
Once the cake is done, take it out of the oven, and spread the toffee over it. Bake for a further 10 minutes, in the top part of the oven.

Batter
Toffee, pre-boil











Toffee, post-boil
Spread across the top