Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've configured my sshd to run duo security via the FORCE_COMMAND option in the ssh config. That means that every time I login via ssh the duo security checks kick in which normally is a good thing. However, for the git login, I don't want these to kick in and I want to go straight through to the git-shell. This is bad for me because the git-shell correctly errors and doesn't allow me to send git commands. I get the error: fatal: unrecognized command '/usr/sbin/login_duo'. This is because the git-shell (by design) knows nothing of /usr/sbin/login_duo.

Is there any way to only run the FORCE_COMMAND for specific users? Any suggestions around how to get around this? Is the best way to create a separate sshd for just git?

share|improve this question
up vote 4 down vote accepted

You can configure sshd's force command support on a per-pubkey granularity rather than globally in sshd_config. See the example in the duo_unix documentation:

So you can wrap any pubkey of any user with login_duo by using "command=" in that user's ~/.ssh/authorized_keys.

share|improve this answer

Your Answer


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.