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'
<snip>
LDFLAGS_EX =
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.
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. – Nikhil Mulley Jan 17 '12 at 16:23