TalkTalk WiFi Hub (Sagemcom Fast 5364) – Enabling SSH

So you have a TalkTalk WiFi Hub and you want to enable SSH? Maybe want to view the DSL line statistics in more detail, or make other changes? This guide will show how to do just that.
I must however before I begin, say that I am writing this out purely from my experience, I am not responsible for any content of the external source websites referred to in the guide, neither will I be held responsible for any damage that may occur your WiFi hub from trying this. This is not official, or supported by TalkTalk, try this at your own risk and with no expectations that TalkTalk or myself will support you if anything goes wrong etc.
By default SSH is disabled as you would expect, given TalkTalk wouldn’t want anyone messing with their router using SSH. However SSH is built into the firmware and can be switched on by pasting a certain string of code within the console element normally found when pressing F12 on any modern browser. This will allow you to login with an SSH client and administer the router with more permissions.
A point to note is that if the router is reset, SSH will then be disabled again, and you will need follow the process below again to enable it. Likewise if you wish to disable SSH again you can just reset the router.
Enabling SSH:
To enable SSH you will first need downgrade your firmware version that your WiFi Hub has installed, if it is any version above SG4K10002600t. This is due to versions above 2600t having the enabling SSH loophole patched within the firmware, so SSH cannot be enabled using firmware versions above this. If your version is already or below SG4K10002600t, skip to stage 2.
To find out which version of the WiFi Hub firmware you currently have installed go to http://192.168.1.1, and where it says “TalkTalk Wi-Fi Hub, Version” near the bottom of the page the firmware version will be listed and will start with SG4K1000. When downgrading a safe bet would be to downgrade to SG4K10002600t or below, you can find previous versions of the firmware here: https://forum.openwrt.org/t/openwrt-based-talktalk-sagemcom-fast-5364-tinkering/49961/69
1. Downgrading the firmware version
To downgrade the firmware go to http://192.168.1.1, and log in into the WiFi Hub using the username and password on the rear of the router behind the pullout WiFi card, alternately enter your custom credentials if you have changed the defaults.

Once Logged in you, you will be presented with the below screen, click “See internet settings”.

You will the be presented with the internet connection status page/dashboard. Click “Manage advanced settings”.

After this then Click on “TalkTalk Wi-Fi Hub” as shown below, this will open the WiFi Hub’s advanced settings so we can downgrade the firmware.

Navigate to the Maintenance tab, and click on software update in the left side pane, and click “Choose File” as shown below. You will then be prompted to find the firmware file you downloaded earlier and saved.

Once found and selected, you will see next to where it says “Choose File” the firmware file name, make sure it looks ok, at least the first half, and click “Update”.

You will then receive a prompt like below, click “Yes” to confirm the firmware downgrade.

You will then see a status message explaining the WiFi Hub is now rebooting. During this time the software will be downgraded to the version you had selected earlier. You may see the WiFi Hub’s LEDs flash quickly or alternate colours this is normal, and tells the user firmware update/downgrade is in progress. Give it a 3-5 mins for it to be installed and then proceed to the next stage below.

2. Enter the code to enable SSH
After the WiFi Hub has been downgraded to a previous version of the firmware (SG4K10002600t, or lower), verify this then proceed to login. Login into the WiFi Hub as you would normally using the steps previously in this guide. In this example I navigated back to the advanced setting page, to input the code, however this should work on any page.
To input the code, press F12 on any browser (not sure if this supported on MAC OS X users using Safari), and if your using Google Chrome like me, you should see a sub window appear to the right side, click on the console tab. Once in the console tab, enter or copy the following code here below:
$.xmo.setValuesTree(true,”Device/UserAccounts/Users/User[@uid=3]/RemoteAccesses/RemoteAccess[@uid=3]/Enabled”)
Once copied and pasted or entered manually, press enter on your keyboard to apply the change.

You may receive the message below, this is normal, as you wouldn’t expect to get a response for entering this code. After this you can now proceed to the testing stage below.

3. Testing
You have now successfully enabled SSH on your WiFi Hub, woo! Time to test it out, to do this you will need to install a client or tool that is capable of communicating with the WiFi Hub using SSH, as Windows operating system does not have a built in SSH client. I have installed the popular Putty software to act as the SSH client. You can get Putty from here:
Now you have the software installed etc, open your SSH client, in my case Putty, click SSH as the connection type and enter the IP address of the WiFi Hub, in my case here it is 192.168.1.1, however for you this may be different if you have changed it. Check the port is listed as 22, which the standard default for SSH, once verified click “Open”.

You should then get the following message like me if you are using Putty, and if this is the first time connecting to the device via SSH. Click “Yes” to proceed.

You should now see you are now connected over SSH to the TalkTalk WiFi Hub, you will be initially prompted to login, enter the login details you would use to login to your router via the web interface like we had previously in the article. Once logged in you will see similar an output to that below. If you get this you have successfully enabled SSH and you can now make more in depth administrative changes, view the DSL line statistics in more detail, etc.

4. Upgrading the firmware version back to what it was
Now that SSH is successfully enabled and tested to ensure you can login, you can now upgrade the WiFi Hub’s firmware back to the firmware version it was on previously. In this case it was SG4K10002816t which happens to also be the most up to date current version of the firmware at the time of writing. To update back to the new version of the firmware, follow the steps in the section of the 1 of the article, however selecting the newest version of the firmware you have downloaded. After this SSH should still be enabled and working, as it will have retained all settings in the firmware as part of the upgrade.

Sources:
https://forum.openwrt.org/t/openwrt-based-talktalk-sagemcom-fast-5364-tinkering/49961