int remctl_open(struct remctl *r, const char *host,
unsigned short port,
const char *principal);
If no principal is specified and the default is used, the underlying GSS-API library may canonicalize host via DNS before determining the service principal, depending on your library configuration. Specifying a principal disables this behavior.
The remctl protocol uses Kerberos v5 via GSS-API for authentication. The underlying GSS-API library will use the default ticket cache for authentication, so to successfully use remctl_open(), the caller should already have Kerberos tickets for an appropriate realm stored in its default ticket cache. The environment variable KRB5CCNAME can be used to control which ticket cache is used.
The canonicalization behavior is controlled by the GSS-API library; with the MIT Kerberos GSS-API library, canonicalization can be disabled by setting "rdns" to false in the [libdefaults] section of krb5.conf. It can also be disabled by passing an explicit Kerberos principal name via the principal argument, which will then be used without changes. If canonicalization is desired, the caller may wish to canonicalize host before calling remctl_open() to avoid problems with multiple DNS calls returning different results.
The default behavior, when a port of 0 is given, of trying 4373 and falling back to 4444 will be removed in a future version of this library in favor of using the "remctl" service in /etc/services if set and then falling back on only 4373. 4444 was the poorly-chosen original remctl port and should be phased out.
The current version of the remctl library and complete details of the remctl protocol are available from its web page at <http://www.eyrie.org/~eagle/software/remctl/>.