diff --git a/.gitignore b/.gitignore index cb91be4..241aed2 100644 --- a/.gitignore +++ b/.gitignore @@ -176,5 +176,5 @@ cython_debug/ a.out *.out *.o -server -client +sample/sample_server +sample/sample_client diff --git a/client/cli.keytab b/client/cli.keytab new file mode 100644 index 0000000..0dd6731 Binary files /dev/null and b/client/cli.keytab differ diff --git a/client/env b/client/env new file mode 100755 index 0000000..16a7856 --- /dev/null +++ b/client/env @@ -0,0 +1,4 @@ +PWD=$(pwd) +KRB5_CONFIG=${PWD}/client/krb5.conf +KRB5CCNAME=FILE:/tmp/krb5cc_cli_%{uid} +KRB5_CCNAME=FILE:/tmp/krb5cc_cli_%{uid} diff --git a/client/krb5.conf b/client/krb5.conf new file mode 100755 index 0000000..b1d6ee2 --- /dev/null +++ b/client/krb5.conf @@ -0,0 +1,20 @@ +[logging] +default = FILE:/var/log/krb5libs.log +kdc = FILE:/var/log/krb5kdc.log +admin_server = FILE:/var/log/kadmind.log + +[libdefaults] +default_realm = TEST.COM +default_ccache_name = FILE:/tmp/krb5cc_cli_%{uid} +dns_lookup_realm = false +dns_lookup_kdc = false +ticket_lifetime = 24h +renew_lifetime = 7d +forwardable = true + +[realms] +TEST.COM = { + kdc = krb5-kdc-server:88 + admin_server = krb5-kdc-server +} + diff --git a/sample/Makefile b/sample/Makefile index 4a32714..389544f 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -1,7 +1,7 @@ CC=gcc -PROGRAM=client server +PROGRAM=sample_client sample_server LIBSSL_LIBS=-lsasl2 @@ -14,17 +14,17 @@ all: $(PROGRAM) @echo "build seccess!" @echo "" -client:sample-client.c +sample_client:sample-client.c $(CC) -g -c sample-client.c $(FINAL_FLAG) - $(CC) -g -o client sample-client.o $(FINAL_FLAG) + $(CC) -g -o sample_client sample-client.o $(FINAL_FLAG) rm *.o -server:sample-server.c +sample_server:sample-server.c $(CC) -g -c sample-server.c $(FINAL_FLAG) - $(CC) -g -o server sample-server.o $(FINAL_FLAG) + $(CC) -g -o sample_server sample-server.o $(FINAL_FLAG) rm *.o clean: - rm server client + rm sample_server sample_client diff --git a/server/env b/server/env new file mode 100755 index 0000000..5e1daa2 --- /dev/null +++ b/server/env @@ -0,0 +1,3 @@ +PWD=$(pwd) +export KRB5_CONFIG=${PWD}/server/krb5.conf +export KRB5CCNAME=/tmp/krb5cc_hadoop_1000 diff --git a/server/hadoop.keytab b/server/hadoop.keytab new file mode 100644 index 0000000..6c3ced5 Binary files /dev/null and b/server/hadoop.keytab differ diff --git a/server/krb5.conf b/server/krb5.conf new file mode 100755 index 0000000..aba5aa5 --- /dev/null +++ b/server/krb5.conf @@ -0,0 +1,20 @@ +[logging] +default = FILE:/var/log/krb5libs.log +kdc = FILE:/var/log/krb5kdc.log +admin_server = FILE:/var/log/kadmind.log + +[libdefaults] +default_realm = TEST.COM +default_ccache_name = FILE:/tmp/krb5cc_hadoop_%{uid} +dns_lookup_realm = false +dns_lookup_kdc = false +ticket_lifetime = 24h +renew_lifetime = 7d +forwardable = true + +[realms] +TEST.COM = { + kdc = krb5-kdc-server:88 + admin_server = krb5-kdc-server +} +