At my workplace, we're using sudo-ldap to provide sudo privileges across the network from a centralised store. We do this based on the username plus the hostname they're running sudo on, e.g.:
sudoHost: foo1 sudoUser: user1
I want to be able to match the sudoHost attribute based on the FQDN rather than the short hostname, so that we can use DNS subdomains for different environments - e.g. use
web1.dev.example.com in the development environment and
web1.test.example.com in the test environment and so on. However, right now sudoHost only matches on the short hostname.
i.e. this works:
But this doesn't work:
The problem with just having the short hostname (
foo1) is that it matches across all environments -
foo1.staging, etc. I want it to be more granular than that.
Is it possible to get sudo-ldap to query based on the FQDN (as returned by
hostname -f) rather than just the short hostname?
I've googled with no success. I can't find anything in the man page or online; the closest it gets when talking about sudoHost attribute is:
A host name, IP address, IP network, or host netgroup (prefixed with a '+'). The special value ALL will match any host.
No mention of FQDN vs. short hostname. There was no mention of FQDN vs. short hostname in the Configuring ldap.conf section either.
The host in question is running Ubuntu 10.04.