Enabling ssh using a symlink on an USB-stick (Network space 2)

Procedure for firmware version 2.2.8
Taken from kea’s post, including comments, on the forum.

ln -s /etc/initng/runlevel/default.runlevel default.runlevel ln -s /etc/shadow shadow
 * Mount an ext2 (Linux) or HFS+ (Mac OS X) formatted USB stick on a Linux or Mac OS X computer.
 * Create two symlinks on your stick:
 * Mount the stick on your NS2.
 * Launch the file browser from the web console, browse to the USB share.
 * Right click on default.runlevel, select open in -> other -> source editor.
 * Fix the sshd entry.
 * Reboot.
 * Edit the shadow using the method above, copy the admin hash to the root account.
 * ssh as root to your NS2 on port 2222.

The NS2 seems to write the default hash to /etc/shadow on each reboot, so you will have to re-edit the shadow file on each boot to allow root login. (Other config files, such as Transmission’s, get set back to their defaults on reboot as well.) If you want to enable root access that doesn’t have to be redone on each boot, you need to use ssh keys. The NS2 accepts key authentication by default so it’s just a matter of adding your key to /root/.ssh/authorized_keys.

Procedure for firmware versions 1.9.2-2.0.5

 * In Linux/MacOS, format an USB stick/disk ext2/3, and create a symlink on it:

ln -s / theroot


 * Plug it in the NS2, and use the AjaXplorer ('File browser') to follow the symlink to the root.
 * Download /etc/initng/runlevel/default.runlevel, add a line with 'sshd' (without quotes; or remove the # if there is already a line with '#sshd'; beware, you'll have to use *nix lineendings, when on Windows, PsPad can do it for you), and upload it again.
 * Download /etc/shadow, copy the hashed password of admin (which you know) to root and upload it again. (lineendings!) The hashed password is everything between the first and second column . Now the password for root is equal to the password for admin.
 * Reboot, and you should be able to login using ssh. Ssh listens on either port 22 (e.g. firmware 1.2.92) or port 2222 (e.g. firmware 2.0.5).

Lacie resets the password for root every time you add or change a user through the web interface. Therefore, it is recommended to login with a keypair:
 * Create a keypair, and put the public key in /root/.ssh/authorized_keys.

See also the forum.