File system went read only after adding ssh key

Posted December 4, 2014 6k views

I followed this guide to set up ssh key on my digital ocean droplet, but since I made step 4 my file system went read-only. I changed /etc/ssh/sshd_config from PermitRootLogin yes to PermitRootLogin without-password and then reload ssh; and when I logged back in, I had no writing rights anymore.

I can log in using ssh root@ but it does not ask me for any password, and I can not modify any file.

Before doing this, I upgraded my ubuntu from 12.04 to 14.04, it asked me during the upgrade which setting did I want for PermitRootLogin and when I looked at /etc/ssh/sshd_config after the installation (and after adding my ssh key) it was set on PermitRootLogin yes.

1 comment
  • I ran dmesg | grep "EXT4-fs error" to see if I have any issues related to the filesystem / journaling system itself.

    It returned many times:
    [68241.757233] EXT4-fs error (device vda): htree_dirblock_to_tree:892: inode #533953: block 2108070: comm updatedb.mlocat: bad entry in directory: rec_len is smaller than minimal - offset=0(0), inode=0, rec_len=0, name_len=0

    And when I run sudo fsck -Af -M, it returns Unable to resolve 'UUID=XYZ:

    root@DropletName:~# sudo fsck -Af -M
    fsck from util-linux 2.20.1
    fsck.ext4: Unable to resolve 'UUID=b96601ba-7d51-4c5f-bfe2-63815708aabd'

    What can I do?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

Run this, and give me the output:

fsck -n

Also, if it comes up with errors, you have 2 choices, with choice 1 being:

  • Power down the system
  • From DO control panel, put system into recovery
  • boot the system
  • from web console, run “fsck -yf /dev/vda1”. If that fails, run “fsck -yf /dev/sda”
  • power down the machine after it completes
  • exit recovery mode
  • power system back up

Second choice is as follows:

  • Open up web console
  • reboot system
  • boot into single user mode
  • run fsck -r
  • reboot

After a Power cycle I had nothing anymore. I went to the Consol Access and I had to reboot. Then it asked me if I want to solve some problems. I said yes, and it solved them.