this will leave `keys` nil and we cannot add that to a string later. I suggest

    keys = File.read('/root/.ssh/authorized_keys')  rescue ""