.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Kadm5 3pm" .TH Kadm5 3pm "2010-02-11" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Heimdal::Kadm5 \- Perl extension for adminstration of Heimdal Kerberos servers (kadmin) .SH "SYNOPSIS" .IX Header "SYNOPSIS" use Heimdal::Kadm5; .PP \&\f(CW$client\fR = Heimdal::Kadm5::Client\->new('Client'=>'you/admin@YOUR.REALM', 'Password'=>'eatmyshorts'); foreach my \f(CW$name\fR ($client\->getPrincipals('*/admin')) { my \f(CW$principal\fR = \f(CW$client\fR\->getPrincipal($name); \f(CW$principal\fR\->dump; } .SH "DESCRIPTION" .IX Header "DESCRIPTION" Heimdal::Kadm5 is a basic \s-1XSUB\s0 perl glue to the Heimdal (http://www.pdc.kth.se/src/heimdal) kadm5clnt library. Heimdal is a free, slightly less export challenged implementation of Kerberos5 by Assar Westerlund and Johan Danielsson. Heimdal::Kadm5 allows you to perform more administration of your kdc than you can usually pull off with the included kadmin program. Heimdal::Kadm5 should be considered alpha-code and may consequently crash and burn but should not muck up your kdc any more than kadmin itself does. .SH "OBJECTS" .IX Header "OBJECTS" \&\f(CW\*(C`Heimdal::Kadm5::Client\*(C'\fR represents a client connection (the truly perverse may conspire to write a kadmin servlet in perl and put that in \f(CW\*(C`Heimdal::Kadm5::Server\*(C'\fR) to a kadmin server. The main object handled by a kadmin server is a \f(CW\*(C`kadm5_principal_ent_t\*(C'\fR (\fIkadm5/admin.h\fR). This type corresponds to the perl class \&\f(CW\*(C`Heimdal::Kadm5::Principal\*(C'\fR. This object is returned by the \f(CW\*(C`getPrincipal\*(C'\fR method of \f(CW\*(C`Heimdal::Kadm5::Client\*(C'\fR and can be created (when adding principals to the kdc) using the \f(CW\*(C`makePrincipal\*(C'\fR method of \f(CW\*(C`Heimdal::Kadm5::Client\*(C'\fR. Note: \fBDo not create Principals directly through \f(CB\*(C`Heimdal::Kadm5::Principal\*(C'\fB\fR. Principals in the traditional sense of the word (i.e things of type \f(CW\*(C`krb5_principal\*(C'\fR) are passed around as strings ('name/instance@REALM' or 'name@REALM'); .SH "METHODS" .IX Header "METHODS" In what follows \f(CW$principal\fR denotes an instance of Heimdal::Kadm5::Principal, \f(CW$name\fR denotes a principal name, \f(CW$bitmask\fR denotes an (you guessed it!) integer representing a bitmask, \f(CW$seconds\fR an integer representing seconds since the epoch (time_t value), \f(CW$client\fR a Heimdal::Kadm5::Client instance. Other variables should be even more obvious or are explained in the text. .SS "Heimdal::Kadm5::Client" .IX Subsection "Heimdal::Kadm5::Client" Minimal use: .PP my \f(CW$client\fR = Heimdal::Kadm5::Client\->new(Client=>'you'); .PP This would connect using a password for 'you@DEFREALM'. The password is prompted on the active tty. .PP A more complex example: .PP my \f(CW$client\fR = Heimdal::Kadm5::Client\->new( RaiseErrors => 1, Server => 'adm.somewhere.net', Port => '8899', # Required: Client => 'you/admin', Realm => '\s-1OTHER.REALM\s0', # \-\-\- Either \-\-\- Password => 'very secret', # \-\-\- Or \-\-\- Keytab => '$HOME/mysecret.keytab' ); .PP Be very careful when using the Password parameter: it implies storing the password in the script or reading it from commmand line arguments or through some other means. Only use this on secured hosts, never from \s-1NFS\s0 mounted filesystems, and \fBnever\fR using principals allowed to perform all operations on the kdc. In this case using a keytable (see \&\fIktutil\fR\|(8) for information on how to create keytabs) is a better way to go. .PP Normally both the Server, Port and Realm parameters are determined from the kerberos context (configuration files, \s-1DNS\s0 etc etc) but you may need to override them. If you leave out the password or set it to undef the client library will prompt you for a password. You must include the Client parameter which is usually your admin or root \-instance depending on your local system of belief. If for some reason the client connection cannot be initialized undef is returned and errors are sent to warn unless the RaiseError parameter is set in which case all errors are propagated by die. .PP my \f(CW@names\fR = \f(CW$client\fR\->getPrincipals($pattern); .PP The getPrincipals method returns a list of principals matching \f(CW$pattern\fR which is not a regular expression but rather a glob-like animal. For instance '*/admin@REALM' is an ok pattern. The elements of the list are principal names which can be used to obtain Heimdal::Kadm5::Principal object using .PP my \f(CW$principal\fR = \f(CW$client\fR\->getPrincipal($name); .PP which returns a Heimdal::Kadm5::Principal object (see the next section for details). .PP my \f(CW$principal\fR = \f(CW$client\fR\->makePrincipal($name); .PP The makePrincipal method takes a principal name and creates an empty Heimdal::Kadm5::Principal object. This is intended for adding principals to the kdc. After creating the principal using makePrincipal use the accessor methods in Heimdal::Kadm5::Principal to set values before adding the principal using .PP \&\f(CW$client\fR\->createPrincipal($principal,$password,$mask); .PP If \f(CW$mask\fR is set this value is used to determine which elements of the principal to include in the creation. Normally this value is automatically determined by tracking the uses of the accessor methods in the Heimdal::Kadm5::Principal class. .PP Modifications to an existing principal is done using this method: .PP \&\f(CW$client\fR\->createPrincipal($principal,$mask); .PP The \f(CW$mask\fR value works in the same way as described above for createPrincipal. It is sometimes useful to disable (lock) a principal, for instance when several operations must be performed. The following methods can be used: .PP \&\f(CW$client\fR\->disablePrincipal($name); .PP \&\f(CW$client\fR\->enablePrincipal($name); .PP Other methods which modify the kdc are and the use of which should be obvious: .PP \&\f(CW$client\fR\->changePassword($name, \f(CW$password\fR); .PP \&\f(CW$client\fR\->deletePrincipal($name); .PP \&\f(CW$client\fR\->renamePrincipal($name, \f(CW$newname\fR); .PP \&\f(CW$client\fR\->randKeyPrincipal($name); .PP This method creates a random set of keys for the principal named \f(CW$name\fR. This is typically done for service principals. When creating a new service principal it is probably a good idea to create the principal with some initial password, disable the principal, apply the randKeyPrincipal method and then enable the principal. .PP \&\f(CW$client\fR\->handle\->\fIc_flush()\fR; .PP This method flushes all modifications to the datastore. It is called automatically when the client handle is DESTROYed if any modifications (password change, create, rename or delete has been performed); .PP \&\f(CW$client\fR\->extractKeytab($principal,$keytab); .PP This method extracts the keys belonging to the principal object to the keytab (optionally) specified by the second argument. If the second argument is missing it defaults to the standard default keytab, typically \fI/etc/krb5.keytab\fR. .SS "Heimdal::Kadm5::Principal" .IX Subsection "Heimdal::Kadm5::Principal" \&\f(CW$principal\fR\->dump($io); .PP Dumps a representation of \f(CW$principal\fR on the \f(CW$io\fR handle (which defaults to \e*STDOUT). This is mostly usable for debugging or simple scripts. .PP my \f(CW$name\fR = \f(CW$principal\fR\->\fIgetPrincipal()\fR; \&\f(CW$principal\fR\->setPrincipal($name); .PP Gets and sets the principal name. .PP my \f(CW$seconds\fR = \f(CW$principal\fR\->\fIgetPrincExpireTime()\fR; \&\f(CW$principal\fR\->setPrincExpireTime($seconds); .PP Gets and sets the time this principal expires. .PP my \f(CW$seconds\fR = \f(CW$principal\fR\->\fIgetLastPwdChange()\fR; .PP Returns the last time this principal's password was changed. .PP my \f(CW$kvno\fR = \f(CW$principal\fR\->\fIgetKvno()\fR; .PP Returns the key version number of this principal's password. .PP my \f(CW$mkvno\fR = \f(CW$principal\fR\->\fIgetMKvno()\fR; .PP Returns this principal's MKvno. .PP my \f(CW$seconds\fR = \f(CW$principal\fR\->\fIgetPwExpiration()\fR; \&\f(CW$principal\fR\->setPwExpiration($seconds); .PP Gets and sets the password expriation time. .PP my \f(CW$seconds\fR = \f(CW$principal\fR\->\fIgetMaxLife()\fR; \&\f(CW$principal\fR\->setMaxLife($seconds); .PP Gets and sets the maximum lifetime of a ticket. .PP my \f(CW$seconds\fR = \f(CW$principal\fR\->\fIgetMaxRenewableLife()\fR; \&\f(CW$principal\fR\->setMaxRenewableLife($seconds); .PP Gets and sets the maximum renewable ticket lifetime. .PP my \f(CW$name\fR = \f(CW$principal\fR\->\fIgetModName()\fR; .PP Returns the principal name of the last modifier of the entry. Not currently (as of heimdal 0.1g) supported by heimdal and contains undef. .PP my \f(CW$seconds\fR = \f(CW$principal\fR\->\fIgetModDate()\fR; .PP Returns the date of last modification of the entry. .PP my \f(CW$policyname\fR = \f(CW$principal\fR\->\fIgetPolicy()\fR; .PP getPolicy returns undef if no policy is set. Policies are not currently supported (as of heimdal 0.1g) and always returns undef. .PP my \f(CW$seconds\fR = \f(CW$principal\fR\->\fIgetLastSuccess()\fR; .PP Last time a successful authentication was done against this principal. .PP my \f(CW$seconds\fR= \f(CW$principal\fR\->\fIgetLastFailed()\fR; .PP Last time a failed authentication was done against this principal. .PP my \f(CW$nfailed\fR = \f(CW$principal\fR\->\fIgetFailAuthCounts()\fR; .PP How many failed login attempts was done against this principal. .PP my \f(CW$bitmask\fR = \f(CW$principal\fR\->\fIgetAttributes()\fR; .PP The bitmask of attributes for this principal. .PP my \f(CW@names\fR = \f(CW$principal\fR\->\fIgetAttributeNames()\fR; .PP The list of attribute names for this principal, expanded from the bitmask. .PP my \f(CW$arrayref\fR = \f(CW$principal\fR\->\fIgetKeyTypes()\fR; .PP getKeyTypes returns an array reference consisting of a list of array references with two elements each: [keytype,salt]. The keytype and salt are strings which describe a key associated with the principal. Note that this data may not be present depending on how the principal was obtained. .PP my \f(CW$password\fR = \f(CW$principal\fR\->\fIgetPassword()\fR; .PP getPassword returns the password if its saved in the Kerberos database. Not the that principal object need to fetched with the bit \s-1KADM5_TL_DATA\s0 set in the mask. .SH "Exported constants" .IX Header "Exported constants" .Vb 10 \& KADM5_ADMIN_SERVICE \& KADM5_API_VERSION_1 \& KADM5_API_VERSION_2 \& KADM5_ATTRIBUTES \& KADM5_AUX_ATTRIBUTES \& KADM5_CHANGEPW_SERVICE \& KADM5_CONFIG_ACL_FILE \& KADM5_CONFIG_ADBNAME \& KADM5_CONFIG_ADB_LOCKFILE \& KADM5_CONFIG_ADMIN_KEYTAB \& KADM5_CONFIG_ADMIN_SERVER \& KADM5_CONFIG_DBNAME \& KADM5_CONFIG_DICT_FILE \& KADM5_CONFIG_ENCTYPE \& KADM5_CONFIG_ENCTYPES \& KADM5_CONFIG_EXPIRATION \& KADM5_CONFIG_FLAGS \& KADM5_CONFIG_KADMIND_PORT \& KADM5_CONFIG_MAX_LIFE \& KADM5_CONFIG_MAX_RLIFE \& KADM5_CONFIG_MKEY_FROM_KEYBOARD \& KADM5_CONFIG_MKEY_NAME \& KADM5_CONFIG_PROFILE \& KADM5_CONFIG_REALM \& KADM5_CONFIG_STASH_FILE \& KADM5_FAIL_AUTH_COUNT \& KADM5_HIST_PRINCIPAL \& KADM5_KEY_DATA \& KADM5_KVNO \& KADM5_LAST_FAILED \& KADM5_LAST_PWD_CHANGE \& KADM5_LAST_SUCCESS \& KADM5_MAX_LIFE \& KADM5_MAX_RLIFE \& KADM5_MKVNO \& KADM5_MOD_NAME \& KADM5_MOD_TIME \& KADM5_POLICY \& KADM5_POLICY_CLR \& KADM5_POLICY_NORMAL_MASK \& KADM5_PRINCIPAL \& KADM5_PRINCIPAL_NORMAL_MASK \& KADM5_PRINC_EXPIRE_TIME \& KADM5_PRIV_ADD \& KADM5_PRIV_ALL \& KADM5_PRIV_CPW \& KADM5_PRIV_DELETE \& KADM5_PRIV_GET \& KADM5_PRIV_LIST \& KADM5_PRIV_MODIFY \& KADM5_PW_EXPIRATION \& KADM5_PW_HISTORY_NUM \& KADM5_PW_MAX_LIFE \& KADM5_PW_MIN_CLASSES \& KADM5_PW_MIN_LENGTH \& KADM5_PW_MIN_LIFE \& KADM5_REF_COUNT \& KADM5_STRUCT_VERSION \& KADM5_TL_DATA \& KRB5_KDB_DISALLOW_ALL_TIX \& KRB5_KDB_DISALLOW_DUP_SKEY \& KRB5_KDB_DISALLOW_FORWARDABLE \& KRB5_KDB_DISALLOW_POSTDATED \& KRB5_KDB_DISALLOW_PROXIABLE \& KRB5_KDB_DISALLOW_RENEWABLE \& KRB5_KDB_DISALLOW_SVR \& KRB5_KDB_DISALLOW_TGT_BASED \& KRB5_KDB_NEW_PRINC \& KRB5_KDB_PWCHANGE_SERVICE \& KRB5_KDB_REQUIRES_HW_AUTH \& KRB5_KDB_REQUIRES_PRE_AUTH \& KRB5_KDB_REQUIRES_PWCHANGE \& KRB5_KDB_SUPPORT_DESMD5 \& USE_KADM5_API_VERSION .Ve .SH "AUTHOR" .IX Header "AUTHOR" Leif Johansson, leifj@it.su.se .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIperl\fR\|(1).