1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
=for stopwords
krb5-sync keytab LDAP username jdoe jdoe's Allbery
=head1 NAME
krb5-sync - Synchronize passwords and status with Active Directory
=head1 SYNOPSIS
B<krb5-sync> [B<-d> | B<-e>] [B<-p> I<password>] I<user>
B<krb5-sync> B<-f> I<file>
=head1 DESCRIPTION
B<krb5-sync> provides a command-line interface to the same functions
provided by the password and status synchronization plugin. It can push a
new password to Active Directory (actually, to any password store that
supports the Kerberos set-password protocol) or activate or deactivate an
account in Active Directory.
To synchronize passwords, provide the B<-p> option and specify the
password. Note that the password is given on the command line and must be
quoted if it contains special characters, and the password will be exposed
to any other users on the system where this command is run. This is
useful primarily for testing and should not be used with production
passwords. Synchronization to Active Directory will be attempted based on
the configuration in F<krb5.conf> (see below).
To enable or disable an account, provide the B<-e> or B<-d> option
respectively. These options can also be provided in conjunction with the
B<-p> option to take both actions at once.
In either case, I<user> should be the principal name for which these
actions should be taken. I<user> may be either unqualified or in the
local realm; either way, the Active Directory realm in which to make
changes will be taken from the F<krb5.conf> configuration.
Alternately, B<krb5-sync> also supports processing actions from a file.
To do this, use the B<-f> flag and give the file on the command line. The
format of the file should be as follows:
<account>
ad
password | enable | disable
<password>
where the fourth line is present only if the <action> is C<password>.
<account> should be the unqualified name of the account. The second line
should be the string C<ad> to push the change to Windows Active Directory.
The third line should be one of C<password>, C<enable>, or C<disable>,
corresponding to the B<-p>, B<-e>, and B<-d> options respectively. The
C<enable> and C<disable> actions are only supported for AD.
The file format is not particularly forgiving. In particular, all of the
keywords are case-sensitive and there must not be any whitespace at the
beginning or end of the lines (except in the password, and only if that
whitespace is part of the password), just a single newline terminating
each line.
When the B<-f> option is given, the file will be deleted if the action was
successful but left alone if the action failed.
The configuration block in F<krb5.conf> should look something like this:
krb5-sync = {
ad_keytab = /etc/krb5kdc/ad-keytab
ad_principal = service/sync@WINDOWS.EXAMPLE.COM
ad_realm = WINDOWS.EXAMPLE.COM
ad_admin_server = dc1.windows.example.com
ad_ldap_base = ou=People
}
If the configuration required for an action is not given, that action will
not be performed but will apparently succeed from the perspective of the
B<krb5-sync> utility. Therefore, if this utility reports success but no
change is happening, double-check the configuration to ensure that all
required options are present.
The C<ad_keytab> option specifies the location of a keytab for
authenticating to the other realm, the C<ad_principal> option specifies
the principal to authenticate as (using the key in the keytab), and the
C<ad_realm> option specifies the foreign realm. C<ad_admin_server> is the
host to contact via LDAP to push account status changes. C<ad_ldap_base>
specifies the base tree inside Active Directory where account information
is stored. Omit the trailing C<dc=> part; it will be added automatically
from C<ad_realm>.
Be aware that the C<ad_instances>, C<ad_base_instance>, and
C<ad_queue_only> configuration options that are used by the krb5-sync
plugin are ignored by B<krb5-sync>. The B<krb5-sync> command will push
changes to whatever principal it was given, regardless of the normal
limits on instances, and does not do any of the principal remapping
configured with C<ad_base_instance>.
=head1 OPTIONS
=over 4
=item B<-d>
Disable the specified user in Active Directory. Requires that all of the
ad_* options be set in F<krb5.conf>. This option may not be specified at
the same time as B<-e>.
=item B<-e>
Enable the specified user in Active Directory. Requires that all of the
ad_* options be set in F<krb5.conf>. This option may not be specified at
the same time as B<-e>.
=item B<-f> I<file>
Rather than perform a particular action based on a username given on the
command line, read a queue file and take action based on it. The format
of the queue file is described above. If the action fails, the file will
be left alone. If the action succeeds, the file will be deleted.
=item B<-p> I<password>
Change the user's password to I<password> in Active Directory.
=back
=head1 EXAMPLES
Disable the account "jdoe" in Active Directory (using the AD configuration
found in F<krb5.conf>):
krb5-sync -d jdoe
Change the password of the account C<testuser> in Active Directory to
C<changeme>:
krb5-sync -p changeme testuser@EXAMPLE.COM
The same, except also enable the account in Active Directory:
krb5-sync -e -p changeme testuser
Note that the realm for the user given on the command line is optional and
ignored.
Given a file named F<jdoe-ad-1168560492> containing:
jdoe
ad
password
changeme
the command:
krb5-sync -f jdoe-ad-1168560492
will change jdoe's password to C<changeme> in Active Directory and then
delete the file.
=head1 SEE ALSO
The current version of this program is available from its web page at
L<http://www.eyrie.org/~eagle/software/krb5-sync/>.
=head1 AUTHOR
Russ Allbery <eagle@eyrie.org>
=head1 COPYRIGHT AND LICENSE
Copyright 2007, 2008, 2010, 2012 The Board of Trustees of the Leland
Stanford Junior University
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice and
this notice are preserved. This file is offered as-is, without any
warranty.
=cut
|