I've been trying to get a FreeBSD machine to talk to a networked postgreSQL database. I assumed that the machine had kerberos installed, as it's what I use to log in, and I was told that FreeBSD has it built in(?). I tried to connect to my remote database with psql -h pgteach (the alias for the server, which works fine, as I can ping the machine). I get the message

psql: Kerberos 5 authentication not supported

Googling the problem seems to suggest that I should install one of the ports for Kerberos. Does the postgresql client (version 9.1) specifically need MIT or Heimdal kerberos, or can I just add some config flags to point to the default kerberos libraries?

pg_config returned the following lines (edited for relevance, I think). Let me know if more info is needed.

CONFIGURE = '--with-libraries=/usr/local/lib' '--with-includes=/usr/local/include' '--enable-thread-safety' '--with-openssl' '--with-libxml' '--enable-nls' '--with-gssapi' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd8.2' 'build_alias=amd64-portbld-freebsd8.2' 'CC=cc' 'CFLAGS=-O2 -pipe -fno-strict-aliasing' 'LDFLAGS= -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib -lgssapi' 'CPPFLAGS=' 'CPP=cpp' 'LDFLAGS_SL=-lgssapi'
LDFLAGS = -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib -lgssapi -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -Wl,--as-needed -Wl,-R'/usr/local/lib'
LDFLAGS_SL = -lgssapi
LIBS = -lpgport -lintl -lxml2 -lssl -lcrypto -lz -lreadline -lcrypt -lm

EDIT: I have to use Kerberos, as it's a univeristy-managed server. I've since tried checking the 'Use Heimdall kerberos' in make config, but trying to do sudo make clean install then complains it can't find krb5_sendauth. I know kerberos is installed, as kinit and klist both work fine.

  • Do you need kerberos binding for the client, or your server mandates the kerberos authentication from psql clients? (both would be same) but if its the latter then you would go for the previous one, if not, why do you need kerberos binding at all? For simple authentication: username and password should suffice. Try that first with your psql client. Jan 17 '12 at 16:22
  • If you need krb5 support, then at the build time, check the configure script with --with-krb5 option or something like to build the postgresql libraries with kerberos authentication support. LIBS should also reflect --lkrb5 appended to the list of already compiled libraries. Jan 17 '12 at 16:23
  • If I understand the question again, your server does not support kerberos authentication, so you are not supposed to use gssapi authenication at all, but see if the client can use some other instead of kerberos from client's command line. Jan 17 '12 at 16:51
  • The server is a university-hosted server, and the university uses kerberos for user authentication, so I imagine the server requires that clients authenticate using kerberos. I've updated the question.
    – shearn89
    Jan 17 '12 at 17:07

I managed to solve the issue by ensuring that both GSSAPI and Heimdall Kerberos support were checked in make config. This then compiles fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.