1

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 [email protected] 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.

--- update ---

After reading this answer 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

What should I do?

4
  • I ran dmesg | grep "EXT4-fs error" to see if I have any issues related to the filesystem / journaling system itself. I returned many time: [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 What does it mean?
    – arthur.sw
    Dec 4, 2014 at 14:09
  • Looks like you have filesystem errors and need to run fsck to fix them. What kind of device is a "digital ocean droplet"? Can you boot a Live CD on it, or at least boot it in single-user mode?
    – fkraiem
    Dec 4, 2014 at 14:24
  • digitalocean provide servers on which you have what they called "droplets". At first you connect to them with a password they send by email, and then you are (obviously) strongly advised to either change your password or set an ssh key.
    – arthur.sw
    Dec 4, 2014 at 14:29
  • Your filesystem has errors. Boot into rescue mode and fsck it.
    – psusi
    Dec 4, 2014 at 14:41

1 Answer 1

1

You must setup root password:

sudo passwd

Then restart the ssh service:

sudo service ssh reload

Note: permitting root access especially without password is quite dangerous it makes your system highly vulnerable to external threats.

3
  • I rebooted, it asked me if I want to solve some problems, saying yes solved them. I set a new password as you advised (sudo passwd and sudo service ssh reload), but I can still log in without any password. I still have PermitRootLogin without-password.
    – arthur.sw
    Dec 4, 2014 at 17:04
  • Use this command to re-assign password to root access: sudo passwd root set new password to root, if the new password is accepted. try su root and see if you are asked for password to root. Dec 4, 2014 at 20:22
  • Thanks! I think it did not ask for my password because I only need to enter it once per session. Problem solved!
    – arthur.sw
    Dec 5, 2014 at 10:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .