SSHD replacement

The original Stora firmware has a modified ssh daemon that does not allow regular users to log in via the SSH protocol (but has a loophole to bypass this limitation). There is a way to circumvent the restriction and log in as a regular user ( ). But there is a better solution – to install a standard ssh daemon instead of the “corporate” one. If you want to take advantage of this opportunity, read on this instruction.

Attention! Follow all steps of this manual exactly. If you accidentally (or intentionally) skip a step or incorrectly execute a command, you will lose your SSH access to Stora. To restore it, you need to perform a Recovery Boot operation ! In no case do not restart Stora or exit from an active ssh session until you are sure that you can open and log in to a new ssh session after replacing the sshd “branded” daemon with a standard one.

Replacing with the HHWU binary file ( easy way )

  • Copy the sshd.tar.gz file ( ) to your Stora using scp or transferring it using a shared access function from another computer. Do not unpack the .tar.gz file under the Windows operating system!
  • Make sure you are root!
  • Navigate to the directory where you copied the .tar.gz file and unzip it:
    tar xvzf sshd.tar.gz
  • Create a backup of the existing sshd daemon and stop it (if it is running):
    cp / usr / sbin / sshd /usr/sbin/sshd.netgear chmod -x /usr/sbin/sshd.netgear
  • From now on, do not disconnect the ssh session or restart Stora, otherwise you will not be able to log in again!
  • Put the new sshd daemon instead of the old one and make sure that it starts up (make it run):
    mv sshd / usr / sbin / sshd chmod + x / usr / sbin / sshd
  • Restart the sshd service :
    /etc/init.d/sshd restart
  • Watch for bugs carefully! If in the command line output you have [OK] everywhere , try opening a new ssh session on your Stora using the login and password of a regular user. If you successfully log into Stora under a new ssh session, everything went well with you!

Note! Since you are now using a new clean SSH server, your login to Stora will be just your usual username [username] , but not [username] _hipserv2_netgear_ [productkey] , as it was before.

  • If during the execution you have any error, double check all your steps. One of the most common is that the new sshd daemon file is placed in the wrong place. Or the flag of the executable file + x is not assigned to it . You can make sure that everything is done correctly with the command:
    -bash-3.2 # ls -la / usr / sbin / sshd -rwxr-xr-x 1 root users 354872 Apr 21 15:23 / usr / sbin / sshd

Enjoy using your Stora!

Replacing with Optware binary file ( more difficult method )

Please note that this method is strongly discouraged, since the sshd daemon in this case will reside on the Stora hard disk and is connected to the flash memory via a link. If for any reason the Stora hard drive fails, you will not be able to connect to your device via the SSH protocol, as the service simply does not start!

This method requires a bit more work, but the daemon binary file in this case will have the latest version available in the repository. To replace the “corporate” daemon with a standard one in this way, you first need to install the ipkg package manager ( ). Also pay attention ! All paths in the Stora file system presented here imply that you followed all the instructions in the above manual (meaning changing the value of the PATH variable).

  • Now that you have read carefully, let’s download and install the new ssh package:
    sudo ipkg install openssh
  • Then rename the old daemon by replacing it with a new file:
    cd / usr / sbin sudo mv sshd sshd.old
  • It remains for us to make a symbolic link to the new sshd file :
    sudo ln -s / home / opt / sbin / sshd / usr / sbin / sshd
  • And set the executable flag for it:
    cd / usr / sbin sudo chmod a + x sshd

Additional steps

In order to reduce wear on your NAND flash memory, you can copy the ssh service configuration files to your Stora hard disk. In this case, you will be insured against their possible loss in case of NAND failure.

  • First of all, copy the ssh configuration files to the hard disk:
    sudo cp -r / etc / ssh / home / opt / etc /
  • Now rename the ssh directory containing the service configuration files. Thus you protect yourself from possible accidents:
    cd / etc sudo mv ssh ssh.old
  • After that, it remains for us to make a symbolic link to this hard disk directory:
    sudo ln -s / home / opt / etc / ssh / etc / ssh

That’s all. Good luck!

If you installed MySQl using RPM packages or some other automated method, it is possible that a system database already exists in this directory. If you compiled a package or copied executable files manually, then it may not exist or it is empty. In this case, the mysql database must be created using the mysql_install_db script . If there are no errors, then after the script ends, it will ask you to set a password for the root user. What does it mean?