Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

How can I list the configuration options that ssh/sshd was compiled with?

I'm attempting to troubleshoot a SELinux configuration issue, and want to make sure that SSH was compiled with --with-selinux.

share|improve this question
up vote 2 down vote accepted

I don't think there's a way to list compilation options, but something like SELinux support should be apparent from the libraries that the executable is linked against:

$ ldd /usr/bin/ssh /usr/sbin/sshd | egrep '^/|selinux'
        libselinux.so.1 => /lib/libselinux.so.1 (0x00007fbbfed5f000)

Looks like sshd has SELinux support but ssh doesn't (why would it?) on my system.

Another thing you could check (e.g. in case you had a static binary) is if there binary references some SELinux functions.

strings /usr/sbin/sshd |grep -i selinux
share|improve this answer
Thanks for the reminder about lld. Since sshd is for incoming connections it thus needs to be able to transition SELinux domains for users logging in. SSH by comparison is for outgoing connections and would not need to interact with a SELinux configuration itself (unless you ssh to yourself, in which case sshd is controlling the SELinux transitions anyway). – zod90 Jun 25 '11 at 12:55

I think you may need to look at the packaging system for your distro and find the options it compiles with. Some programs can output their compile flags, but I don't know of such an option for sshd.

share|improve this answer

If you are installing the default distribution packages, and

  • the distribution is Debian based, look at the debian/rules file (basically a Makefile) in the package source for the configuration options.

  • the distribution is rpm based, look at the compilation options, probably in the source rpm's spec file.

For custom distributions like Gentoo, where there are no default compilations options, this is more difficult, and I'd talk to the person who built the package, and also look at ldd as people have suggested.

If you specify your distribution, as you should have done initially, people can presumably give you more specific pointers.

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.