I recently lost my ssh access by changing a setting in /etc/sshd_config.
I was able to recover ssh access by mounting the two WDNAS disks in another(SATA-capable) PC, booting KNoppix 6.1 (tho most any should work), setting up knoppix for RAID1 and accessing the disks to edit sshd_config. The procedure:
NOTE: each cmd line option below prefaced by a SINGLE "-", e.g. "-examine" must be given as TWO dashes. I am not sure why this ajax stuff screws up the two dashes…
1. Mount your WDNAS disks in the new PC
2. Boot Knoppix 6.1 (or whatever), check partitions via "cat /proc/partitions" You should see sda1-4 and sdb1-4. You can also run "cfdisk /dev/sd[a,b]" this will show the partitions as linux raid autodetect. BE CAREFUL, quit.
3. Since Knoppix doesn't have raid modules built in, add to the kernel:
4. Read the existing raid info for partition 1 and put it in file mdadm.conf. The WDNAS "/" is on partition 1:
mdadm -examine -scan /dev/sda1 /dev/sdb1 > /etc/mdadm/mdadm.conf
5. Edit mdadm.conf (vi or ex or edit) and insert "DEVICE /dev/sda* /dev/sdb*" as first line of mdadm.conf. Save it.
6. Start the raid array:
mdadm -assemble /dev/md0
7. Verify raid started by "cat /proc/mdstat"
8. cd to /mnt directory and make a mount point:
9. Mount the raid partition:
mount /dev/md0 /mnt/md0
10. go to the mount location and find the WDNAS / filesystem:
ls -l > you should see the linux / filesystem!!
11. cd etc and edit sshd_config.
12. sync;sync;sync; to write all changes.
13. cd back to login directory
14. I tried to shutdown raid, but didn't seem to work (device busy -not sure why)
mdadm -stop /dev/md0
15. shutdown -h now
15. replace your WDNAS disks in the correct order!
16. Go tell your boss how smart you are!