As soon as af123 posts about the webif update on the announcements thread, I will be 'liking' it, and I hope that others do the same.
It's good that you know about key pairs, but others may not, so here goes...
In order to securely access your Humax from the outside using SSH, you need to find an alternative to the use of passwords and that is done using a pair of electronic keys. The keys are mathematically matched using a relationship that is easy for a computer to prove but is difficult to reconstruct if you only have one half. By 'difficult', I mean could it could take many many computers working full-time over decades and they still wouldn't crack it. The way that this works in practice is that one key is publicly used and the other is kept private and is passworded. To get access to the Humax, you save a copy of the public key on it and you keep the private key with you on a USB stick - when you want to log in to your box, you point PuTTY at the private key and it asks you for the password. If and only if everything works out, you get in.
So, how does that work in practice?
As we are using PuTTY in this example, this is what we will continue to use. There is a utility that comes with PuTTY called PuTTYgen and, if you have not got it already, then go to the website at
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html and download it.
Before you start, think of a good password - there is no point making use of heavy-duty cryptomathematics and then securing the private key with the passphrase 'letmein'. You will do everything to protect your private key, but if you do lose your USB stick, you need to make sure that you can sleep easy at night.
Run PuTTYgen and click the "Generate" button. Then waggle the mouse around in the window until the green bar reaches the end. When prompted, enter and confirm your passphrase.
Next, save the public and the private keys somewhere safe that you know is backed up but that nobody else has access to.
Then, select the text in the box marked "Public key for pasting into the OpenSSH Authorized keys file" and copy it.
There is a simple Youtube video on this part of the process which you can use to see the process in advance, here:
[Edit - that's fancy, I meant to just paste the link but it's been embedded, which is pretty neat
]
Now, telnet or SSH into the Humax and run the following commands:
Code:
cd /mod
mkdir .ssh
chmod 700 .ssh
cd .ssh
echo "<paste your public key in here>" > authorized_keys
chmod 600 authorized_keys
To test that this has worked, open PuTTY and edit the PuTTY session that you saved (see above) and go to Connection>SSH>Auth - in the box marked "Private Key File for Authentication", browse to the private key file that you generated with PuTTYgen.
Save the session and then open it.
You will be prompted for a username and then, instead of the password it will say "Authenticating with public key..." and ask you for the passphrase of the key. Type the password that you set above and hit return.
If all goes well, then you will have the usual "humax#" prompt.
If you don't get this prompt then don't worry because you can still telnet into the box to fix it. SSH will work as well, but you will need to temporarily delete the link to the key file so that you can go back to using password authentication.
Debugging - the 3 things that most often go wrong here are:
1) Incorrect access rights on /mod/.ssh (ls -al should show it as 'drwx------' Also, don't forget that the directory name has a '.' in front of it.
2) Incorrect access rights on /mod/.ssh/authorized_keys (ls -al should show it as 'rw-------') Also, don't forget the spelling - it's 'authorized' not 'authorised'.
3) Mistakes in pasting in the public key into the authorized_keys file - make sure that there is only one line and that there are no spaces in the long string of digits.
Once this has been sorted, we can move onto disabling passwords and accessing the Humax from the outside.