Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Good day All. I have a remote server running raid 1 which I connect to using ssh keys.

I accidentally moved the /root/.ssh folder and need to put it back so I can log on again.

The people I rent off provide a rescue shell and I can log on there OK but my knowledge of manipulating raid 1 arrays is almost zero so I read up on it and tried this.

mdadm -A -R /dev/md0 /dev/sdb2

mount /dev/md0 /mnt

which seemed to work OK (I moved the .ssh folder back to root) so I then

umount /mnt

mdadm -S /dev/md0

and rebooted the system which after about 40 minutes came up OK but I still could not log on.

I went in again and the changes I had made were still on the disk (/root/.ssh was were I changed it to) so I made a change to the web directory so I could see if they worked after i rebooted (changed the name of a directory) when I rebooted the directory still had the old name so my changes are not being recognised.

I dont want to try anything else in case I totally destroy the system. I can not see how the disks can be in sync but everything is working fine and I am still locked out.

If someone could enlighten me with the proper way to handle this it would be much appreciated.

share|improve this question
add comment

1 Answer

Maybe you could be facing some permission problem to log in. Openssh is pretty strong on Unix filesystem permission enforcement. You'll probably need to recheck permissions, and give the following to ssh related files:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub  
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts

And no directory above ~/.ssh can have 'group' or 'other' write permissions.

You could double-check your raid status the following way(if the partitions are "Linux Raid Autodetect" type):

mdadm --assemble --scan
cat /proc/mdstat

Personalities : [raid1] 
md1 : active raid1 sda2[0] sdb2[1]
  243610368 blocks [2/2] [UU]

md0 : active (auto-read-only) raid1 sda1[0] sdb1[1]
  529024 blocks [2/2] [UU]

unused devices: <none>

If there is something wrong, you'll notice on this file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.