Bad owner or permissions on /root/.ssh/config in a virtual machine

The proper solution is to stop using root to check out a git repository. Give each user their own account and keep the permissions tight enough that security isn't compromised.

A different solution would be to use one of the web-based git servers rather than an SSH-based one. I've never used any of those so I can't give you much advice there.


Disclaimer: I now believe this is a permissions check by the git client, not the ssh server. That would make this answer incorrect. I am leaving my answer here so that we don't have to go over the topic again.

I really don't want to answer this, but someone is going to post the answer you're looking for eventually and it may as well be with the appropriate disclaimers.

  1. Don't do this. Everyone else has been steering you away from this answer for a reason. It's terrible security.
  2. No, really. Don't do this. No matter how convenient it may seem, this goes against some of the most basic security conventions that are taken for granted in the Unix industry. You will lose a great deal of respect from those in your professional life if they discover that you have done this, even if it's casually on your own system.
  3. You are asking to be owned.
  4. If you're still determined on going through with this...

The answer is in man sshd_config, you're looking for StrictModes. It cannot be configured on a per-user basis; that's very deliberate.


A solution do this that would permit you to still have /root as a 'shared folder' would be to use the AuthorizedKeysFile in your sshd_config file, and set it to pull your authorized keys from some other directory.