activesambaldap 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/NEWS.en +9 -0
- data/NEWS.ja +10 -0
- data/README.en +310 -0
- data/README.ja +307 -0
- data/Rakefile +95 -0
- data/bin/asl-groupadd +70 -0
- data/bin/asl-groupdel +58 -0
- data/bin/asl-groupmod +133 -0
- data/bin/asl-groupshow +31 -0
- data/bin/asl-passwd +99 -0
- data/bin/asl-populate +96 -0
- data/bin/asl-purge +24 -0
- data/bin/asl-samba-computeradd +94 -0
- data/bin/asl-samba-groupadd +55 -0
- data/bin/asl-samba-groupdel +53 -0
- data/bin/asl-samba-groupmod +98 -0
- data/bin/asl-samba-useradd +98 -0
- data/bin/asl-samba-userdel +47 -0
- data/bin/asl-samba-usermod +92 -0
- data/bin/asl-useradd +263 -0
- data/bin/asl-userdel +75 -0
- data/bin/asl-usermod +335 -0
- data/bin/asl-usershow +31 -0
- data/lib/active_samba_ldap/account.rb +199 -0
- data/lib/active_samba_ldap/base.rb +126 -0
- data/lib/active_samba_ldap/command.rb +94 -0
- data/lib/active_samba_ldap/computer.rb +13 -0
- data/lib/active_samba_ldap/computer_account.rb +34 -0
- data/lib/active_samba_ldap/configuration.rb +322 -0
- data/lib/active_samba_ldap/dc.rb +17 -0
- data/lib/active_samba_ldap/entry.rb +80 -0
- data/lib/active_samba_ldap/group.rb +182 -0
- data/lib/active_samba_ldap/idmap.rb +17 -0
- data/lib/active_samba_ldap/ou.rb +18 -0
- data/lib/active_samba_ldap/populate.rb +254 -0
- data/lib/active_samba_ldap/samba_account.rb +200 -0
- data/lib/active_samba_ldap/samba_computer.rb +20 -0
- data/lib/active_samba_ldap/samba_group.rb +126 -0
- data/lib/active_samba_ldap/samba_user.rb +39 -0
- data/lib/active_samba_ldap/unix_id_pool.rb +41 -0
- data/lib/active_samba_ldap/user.rb +14 -0
- data/lib/active_samba_ldap/user_account.rb +30 -0
- data/lib/active_samba_ldap/version.rb +3 -0
- data/lib/active_samba_ldap.rb +29 -0
- data/lib/samba/encrypt.rb +86 -0
- data/misc/rd2html.rb +42 -0
- data/rails/plugin/active_samba_ldap/README +30 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/scaffold_asl_generator.rb +28 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/computer.rb +3 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/dc.rb +3 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/group.rb +3 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/idmap.rb +3 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/ldap.yml +24 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/ou.rb +3 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/samba_controller.rb +12 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/samba_helper.rb +2 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/samba_index.rhtml +17 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/samba_populate.rhtml +15 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/samba_purge.rhtml +10 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/unix_id_pool.rb +3 -0
- data/rails/plugin/active_samba_ldap/generators/scaffold_asl/templates/user.rb +3 -0
- data/rails/plugin/active_samba_ldap/init.rb +6 -0
- data/test/asl-test-utils.rb +276 -0
- data/test/command.rb +64 -0
- data/test/config.yaml.sample +17 -0
- data/test/run-test.rb +18 -0
- data/test/test-unit-ext/always-show-result.rb +28 -0
- data/test/test-unit-ext/priority.rb +159 -0
- data/test/test-unit-ext.rb +2 -0
- data/test/test_asl_groupadd.rb +69 -0
- data/test/test_asl_groupdel.rb +88 -0
- data/test/test_asl_groupmod.rb +256 -0
- data/test/test_asl_groupshow.rb +21 -0
- data/test/test_asl_passwd.rb +125 -0
- data/test/test_asl_populate.rb +92 -0
- data/test/test_asl_purge.rb +21 -0
- data/test/test_asl_useradd.rb +710 -0
- data/test/test_asl_userdel.rb +73 -0
- data/test/test_asl_usermod.rb +541 -0
- data/test/test_asl_usershow.rb +27 -0
- data/test/test_group.rb +21 -0
- data/test/test_password.rb +51 -0
- data/test/test_samba_encrypt.rb +36 -0
- data/test/test_user_home_directory.rb +43 -0
- metadata +177 -0
data/NEWS.en
ADDED
data/NEWS.ja
ADDED
data/README.en
ADDED
@@ -0,0 +1,310 @@
|
|
1
|
+
# -*- rd -*-
|
2
|
+
|
3
|
+
= README.en
|
4
|
+
|
5
|
+
$Id: README.en 56 2006-11-17 08:40:26Z kou $
|
6
|
+
|
7
|
+
== Name
|
8
|
+
|
9
|
+
ActiveSambaLdap
|
10
|
+
|
11
|
+
== What's this?
|
12
|
+
|
13
|
+
ActiveSambaLdap is a library and a management tool for Samba +
|
14
|
+
LDAP environment.
|
15
|
+
|
16
|
+
ActiveSambaLdap provides object-oriented API to manipulate
|
17
|
+
LDAP entry for Samba. ActiveSambaLdap also provides
|
18
|
+
command-line tools to replace smbldap-tools written by Perl.
|
19
|
+
|
20
|
+
== Author
|
21
|
+
|
22
|
+
Kouhei Sutou <kou@cozmixng.org>
|
23
|
+
|
24
|
+
== Licence
|
25
|
+
|
26
|
+
Ruby's.
|
27
|
+
|
28
|
+
== Mailing list
|
29
|
+
|
30
|
+
asl-devel@rubyforge.org
|
31
|
+
|
32
|
+
== Reference manual
|
33
|
+
|
34
|
+
((<URL:http://asl.rubyforge.org/>))
|
35
|
+
|
36
|
+
== Dependency libraries
|
37
|
+
|
38
|
+
* ActiveLdap >= 0.8.0: not released
|
39
|
+
|
40
|
+
== Usage
|
41
|
+
|
42
|
+
=== Use with Rails
|
43
|
+
|
44
|
+
First, install ActiveSambaLdap plugin for Rails. And modify
|
45
|
+
the following URL because the URL is for trunk.
|
46
|
+
|
47
|
+
% script/plugin install svn://rubyforge.org/var/svn/asl/trunk/rails/plugin/active_samba_ldap
|
48
|
+
|
49
|
+
Next, scaffold the environment of ActiveSambaLdap for Rails.
|
50
|
+
|
51
|
+
% script/generate scaffold_asl
|
52
|
+
|
53
|
+
Modify config/ldap.yml generated by scaffold_asl to adapt
|
54
|
+
to your environment. See "Options in configuration file"
|
55
|
+
section to find available options.
|
56
|
+
|
57
|
+
==== Populate
|
58
|
+
|
59
|
+
First, need to populate your Samba + LDAP environment.
|
60
|
+
Access http://localhost:3000/samba after invoking Rails by
|
61
|
+
script/server and so on. And populate your Samba + LDAP
|
62
|
+
environment by following "Populate Samba + LDAP environment"
|
63
|
+
link.
|
64
|
+
|
65
|
+
And you can development your applications with
|
66
|
+
User/Computer/Group classes. You can develop like with
|
67
|
+
ActiveRecord.
|
68
|
+
|
69
|
+
=== Use from command line
|
70
|
+
|
71
|
+
Use asl-* commands. You'll don't use asl-samba-* commands
|
72
|
+
from command line because they are for smb.conf.
|
73
|
+
|
74
|
+
==== Configuration
|
75
|
+
|
76
|
+
First, modify configuration file to adapt to your
|
77
|
+
environment. You can confirm default configuration files by
|
78
|
+
invoking asl-* commands with --help option. For example, you
|
79
|
+
can use asl-populate.
|
80
|
+
|
81
|
+
% asl-populate --help
|
82
|
+
...
|
83
|
+
--config=CONFIG Specify configuration file
|
84
|
+
Default configuration files:
|
85
|
+
/etc/activesambaldap/config.yaml
|
86
|
+
/etc/activesambaldap/bind.yaml
|
87
|
+
/home/kou/.activesambaldap.conf
|
88
|
+
/home/kou/.activesambaldap.bind
|
89
|
+
...
|
90
|
+
|
91
|
+
Configuration files are read from the above files to the
|
92
|
+
below files. Configurations are overridden by latter
|
93
|
+
configuration files. In the above example, configuration
|
94
|
+
files are read by the following order:
|
95
|
+
|
96
|
+
* /etc/activesambaldap/config.yaml
|
97
|
+
* /etc/activesambaldap/bind.yaml
|
98
|
+
* /home/kou/.activesambaldap.conf
|
99
|
+
* /home/kou/.activesambaldap.bind
|
100
|
+
|
101
|
+
The reason why bind.yaml and *.bind are read after
|
102
|
+
config.yaml and *.conf is for security. You should write
|
103
|
+
opened configurations (host name, port number and so on)
|
104
|
+
into config.yaml and *.conf, closed configurations (user
|
105
|
+
name, password and so on) into bind.yaml and *.bind. And you
|
106
|
+
should set suitable permission to bind.yaml and *.bind.
|
107
|
+
|
108
|
+
==== Format of configuration file
|
109
|
+
|
110
|
+
Use YAML format. There are three sections:
|
111
|
+
|
112
|
+
update:
|
113
|
+
# configurations for updating LDAP entries
|
114
|
+
...
|
115
|
+
|
116
|
+
reference:
|
117
|
+
# configurations for referring LDAP entries
|
118
|
+
...
|
119
|
+
|
120
|
+
common:
|
121
|
+
# configurations to share for updating/referring
|
122
|
+
...
|
123
|
+
|
124
|
+
For example:
|
125
|
+
|
126
|
+
common:
|
127
|
+
sid: S-1-5-21-915876905-2926214379-2876160357
|
128
|
+
base: dc=samba,dc=local,dc=net
|
129
|
+
host: localhost
|
130
|
+
method: :tls
|
131
|
+
|
132
|
+
update:
|
133
|
+
bind_dn: cn=admin,dc=local,dc=net
|
134
|
+
password: admin
|
135
|
+
|
136
|
+
reference:
|
137
|
+
allow_anonymous: true
|
138
|
+
|
139
|
+
It's best that you write 'password' configuration into
|
140
|
+
bind.yaml *.bind.
|
141
|
+
|
142
|
+
You must configure 'base'. And you should configure
|
143
|
+
'sid'. You can find your SID by the following command:
|
144
|
+
|
145
|
+
% sudo net getlocalsid
|
146
|
+
|
147
|
+
It's inefficiency that sid isn't configured because 'net
|
148
|
+
getlocalsid' is invoked each time.
|
149
|
+
|
150
|
+
==== Options in configuration file
|
151
|
+
|
152
|
+
The following options are available:
|
153
|
+
|
154
|
+
: base
|
155
|
+
Same as the option of ActiveLdap::Base.establish_connection.
|
156
|
+
: host
|
157
|
+
Same as the option of ActiveLdap::Base.establish_connection.
|
158
|
+
: port
|
159
|
+
Same as the option of ActiveLdap::Base.establish_connection.
|
160
|
+
: scope
|
161
|
+
Same as the option of ActiveLdap::Base.establish_connection.
|
162
|
+
: bind_dn
|
163
|
+
Same as the option of ActiveLdap::Base.establish_connection.
|
164
|
+
: password
|
165
|
+
Same as the option of ActiveLdap::Base.establish_connection.
|
166
|
+
: method
|
167
|
+
Same as the option of ActiveLdap::Base.establish_connection.
|
168
|
+
: allow_anonymous
|
169
|
+
Same as the option of ActiveLdap::Base.establish_connection.
|
170
|
+
|
171
|
+
: sid
|
172
|
+
SID(Security Identifier) of your Samba server.
|
173
|
+
: smb_conf
|
174
|
+
The path of smb.conf for your Samba server.
|
175
|
+
: samba_domain
|
176
|
+
Domain name of your Samba server.
|
177
|
+
: samba_netbios_name
|
178
|
+
NetBIOS name of your Samba server.
|
179
|
+
|
180
|
+
: password_hash_type
|
181
|
+
Algorithm for hashing password in LDAP. Available
|
182
|
+
algorithms are :crypt, :md5, :smd5, :sha and
|
183
|
+
:ssha. Default algorithm is :ssha.
|
184
|
+
|
185
|
+
Password in LDAP is used for recognition in UNIX not Samba.
|
186
|
+
|
187
|
+
: users_suffix
|
188
|
+
Tree for user entries in LDAP. Specify relative path for
|
189
|
+
base. For example: ou=Users
|
190
|
+
: groups_suffix
|
191
|
+
Tree for group entries in LDAP. Specify relative path for
|
192
|
+
base. For example: ou=Groups
|
193
|
+
: computers_suffix
|
194
|
+
Tree for computer entries in LDAP. Specify relative path for
|
195
|
+
base. For example: ou=Computers
|
196
|
+
: idmap_suffix
|
197
|
+
Tree for idmap entries in LDAP. Specify relative path for
|
198
|
+
base. For example: ou=Idmap
|
199
|
+
|
200
|
+
: start_uid
|
201
|
+
UID (User Identifier) for making new user. Next new
|
202
|
+
user's default UID is incremented after making new
|
203
|
+
user. Default is 10000.
|
204
|
+
|
205
|
+
: start_gid
|
206
|
+
GID (Group Identifier) for making new group. Next new
|
207
|
+
group's default GID is incremented after making new
|
208
|
+
group. Default is 10000.
|
209
|
+
|
210
|
+
: user_login_shell
|
211
|
+
Default login shell for new user. Default is /bin/false.
|
212
|
+
: user_home_directory
|
213
|
+
Default home directory for new user. %U is substituted
|
214
|
+
with the user name. Default is /home/%U.
|
215
|
+
: user_home_directory_mode
|
216
|
+
Default permission of user's home directory. Default is
|
217
|
+
0755 (octal notation).
|
218
|
+
|
219
|
+
: user_gecos
|
220
|
+
Default GECOS field value for new user. %U is substituted
|
221
|
+
with user name.
|
222
|
+
|
223
|
+
: user_home_unc
|
224
|
+
Default path for user's home in Windows. The path should
|
225
|
+
be specified by UNC (Universal Naming Convention). %U is
|
226
|
+
substituted with user name. Default is "\\NetBIOS name
|
227
|
+
of your Samba server\%U".
|
228
|
+
|
229
|
+
: user_profile
|
230
|
+
Default path of user profile specified by
|
231
|
+
UNC (Universal Naming Convention). %U is substituted by
|
232
|
+
the user name. Default is "\\NetBIOS name Samba
|
233
|
+
server\profiles\%U".
|
234
|
+
|
235
|
+
: user_home_drive
|
236
|
+
Default drive name of user's home. Default is H:.
|
237
|
+
|
238
|
+
: user_logon_script
|
239
|
+
Default script name that is invoked when user
|
240
|
+
logon. Default is logon.bat.
|
241
|
+
|
242
|
+
# : mail_domain
|
243
|
+
|
244
|
+
: skeleton_directory
|
245
|
+
Default skeleton directory for making user's home
|
246
|
+
directory. Default is /etc/skel.
|
247
|
+
|
248
|
+
: default_user_gid
|
249
|
+
Default GID of group to which user belongs. Default is
|
250
|
+
'Domain Users' group.
|
251
|
+
|
252
|
+
: default_computer_gid
|
253
|
+
Default GID of group to which computer belongs. Default
|
254
|
+
is 'Domain Computers' group.
|
255
|
+
|
256
|
+
# : default_max_password_age
|
257
|
+
|
258
|
+
==== Populate
|
259
|
+
|
260
|
+
You need to populate your Samba + LDAP environment by
|
261
|
+
invoking asl-populate before administrate your Samba + LDAP
|
262
|
+
with asl-*.
|
263
|
+
|
264
|
+
% sudo asl-populate
|
265
|
+
|
266
|
+
You can use the following command if you don't need to root
|
267
|
+
authorization((-root authorization check may be needed...-)).
|
268
|
+
|
269
|
+
% fakeroot asl-populate
|
270
|
+
|
271
|
+
==== Administrate
|
272
|
+
|
273
|
+
Use asl-user*, asl-group*, asl-populate,
|
274
|
+
asl-purge and asl-password. Use --help options for more detail.
|
275
|
+
|
276
|
+
==== Configuration of smb.conf
|
277
|
+
|
278
|
+
You need to configure you smb.conf like the following if you
|
279
|
+
want to administrate with
|
280
|
+
((<Srvtools|URL:http://support.microsoft.com/kb/173673/>))
|
281
|
+
from Windows or make Samba server domain controller.
|
282
|
+
Use asl-samba-* for those propose.
|
283
|
+
|
284
|
+
passdb backend = ldapsam:ldap://127.0.0.0
|
285
|
+
ldap admin dn = cn=admin,dc=local,dc=net
|
286
|
+
ldap suffix = dc=samba,dc=local,dc=net
|
287
|
+
ldap user suffix = ou=Users
|
288
|
+
ldap group suffix = ou=Groups
|
289
|
+
ldap machine suffix = ou=Computers
|
290
|
+
ldap idmap suffix = ou=Idmap
|
291
|
+
ldap passwd sync = yes
|
292
|
+
|
293
|
+
admin users = "@Domain Admins"
|
294
|
+
add user script = /.../asl-samba-useradd "%u"
|
295
|
+
delete user script = /.../asl-samba-userdel "%u"
|
296
|
+
add group script = /.../asl-samba-groupadd "%g"
|
297
|
+
delete group script = /.../asl-samba-groupdel "%g"
|
298
|
+
add user to group script = /.../asl-samba-groupmod "%g" --add-members "%u"
|
299
|
+
delete user from group script = /.../asl-samba-groupmod "%g" --delete-members "%u"
|
300
|
+
set primary group script = /.../asl-samba-usermod "%u" --gid "%g"
|
301
|
+
add machine script = /.../asl-samba-computeradd "%u"
|
302
|
+
|
303
|
+
You need to set LDAP administrator password by the following
|
304
|
+
command before invoke your Samba server.
|
305
|
+
|
306
|
+
% sudo /usr/bin/smbpasswd -W
|
307
|
+
|
308
|
+
== Trouble shootings
|
309
|
+
|
310
|
+
== Thanks
|
data/README.ja
ADDED
@@ -0,0 +1,307 @@
|
|
1
|
+
# -*- rd -*-
|
2
|
+
|
3
|
+
= README.ja
|
4
|
+
|
5
|
+
$Id: README.ja 56 2006-11-17 08:40:26Z kou $
|
6
|
+
|
7
|
+
== 名前
|
8
|
+
|
9
|
+
ActiveSambaLdap
|
10
|
+
|
11
|
+
== なにこれ?
|
12
|
+
|
13
|
+
ActiveSambaLdapはSamba用LDAPエントリを管理するための
|
14
|
+
ActiveRecord風なライブラリです.また,smbldap-toolsのような
|
15
|
+
管理用コマンドラインツールも提供します.
|
16
|
+
|
17
|
+
== 作者
|
18
|
+
|
19
|
+
Kouhei Sutou <kou@cozmixng.org>
|
20
|
+
|
21
|
+
== ライセンス
|
22
|
+
|
23
|
+
Ruby's.
|
24
|
+
|
25
|
+
== メーリングリスト
|
26
|
+
|
27
|
+
asl-devel-ja@rubyforge.org
|
28
|
+
|
29
|
+
== リファレンスマニュアル
|
30
|
+
|
31
|
+
((<URL:http://asl.rubyforge.org/>))
|
32
|
+
|
33
|
+
== 依存ライブラリ
|
34
|
+
|
35
|
+
* ActiveLdap >= 0.8.0: 未リリース
|
36
|
+
|
37
|
+
== 使用法
|
38
|
+
|
39
|
+
=== Railsと使う
|
40
|
+
|
41
|
+
まず,Rails用プラグインをインストールします.以下のURLは
|
42
|
+
trunk用ですので,環境にあわせて変更してください.
|
43
|
+
|
44
|
+
% script/plugin install svn://rubyforge.org/var/svn/asl/trunk/rails/plugin/active_samba_ldap
|
45
|
+
|
46
|
+
次に,Rails用ActiveSambaLdap環境を構築します.
|
47
|
+
|
48
|
+
% script/generate scaffold_asl
|
49
|
+
|
50
|
+
config/ldap.ymlが生成されるので,環境にあわせて編集します.
|
51
|
+
指定できるオプションは,以下の「設定ファイルのオプション」の
|
52
|
+
項を参考にしてください.
|
53
|
+
|
54
|
+
==== 初期化
|
55
|
+
|
56
|
+
はじめに,Samba + LDAP環境を初期化する必要があります.
|
57
|
+
script/serverなどでRailsを起動し,
|
58
|
+
http://localhost:3000/sambaにアクセスしてください.
|
59
|
+
「Populate Samba + LDAP environment」というリンクがあるので,
|
60
|
+
それを使ってSamba + LDAP環境を初期化します.
|
61
|
+
|
62
|
+
あとは,ActiveRecordを利用した開発と同じように,
|
63
|
+
User/Computer/Groupクラスなどを使用して開発してください.
|
64
|
+
|
65
|
+
=== コマンドラインから使う
|
66
|
+
|
67
|
+
asl-*というコマンドを使います.asl-samba-*はsmb.confに設定す
|
68
|
+
るためのコマンドで,ターミナルから使うことはありません.
|
69
|
+
|
70
|
+
==== 設定
|
71
|
+
|
72
|
+
まず,あなたの環境にあわせて設定ファイルを編集します.デフォ
|
73
|
+
ルトで読み込まれるファイルは--helpオプションをつけて起動する
|
74
|
+
と確認できます.asl-*のどのコマンドでも表示されます.例えば,
|
75
|
+
asl-populateを使うとこうなります.
|
76
|
+
|
77
|
+
% asl-populate --help
|
78
|
+
...
|
79
|
+
--config=CONFIG Specify configuration file
|
80
|
+
Default configuration files:
|
81
|
+
/etc/activesambaldap/config.yaml
|
82
|
+
/etc/activesambaldap/bind.yaml
|
83
|
+
/home/kou/.activesambaldap.conf
|
84
|
+
/home/kou/.activesambaldap.bind
|
85
|
+
...
|
86
|
+
|
87
|
+
設定ファイルは上から順に読み込まれていきます.設定内容は後の
|
88
|
+
ファイルで上書きされます.上記の例だと,以下の順序で読み込ま
|
89
|
+
れていきます.
|
90
|
+
|
91
|
+
* /etc/activesambaldap/config.yaml
|
92
|
+
* /etc/activesambaldap/bind.yaml
|
93
|
+
* /home/kou/.activesambaldap.conf
|
94
|
+
* /home/kou/.activesambaldap.bind
|
95
|
+
|
96
|
+
config.yamlや*.confの後にbind.yamlや*.bindを読み込んでいるの
|
97
|
+
はセキュリティ上の配慮です.ホスト名などの見られてもよい情報
|
98
|
+
はconfig.yamlや*.confに書き,認証情報など見られてはまずい情
|
99
|
+
報はbind.yamlや*.bindに書き,適切なパーミッションを設定する
|
100
|
+
とよいでしょう.
|
101
|
+
|
102
|
+
==== 設定ファイルの書式
|
103
|
+
|
104
|
+
YAMLで記述します.三つのセクションからなります.
|
105
|
+
|
106
|
+
update:
|
107
|
+
# LDAPエントリを更新する時の設定
|
108
|
+
...
|
109
|
+
|
110
|
+
reference:
|
111
|
+
# LDAPエントリを参照する時の設定
|
112
|
+
...
|
113
|
+
|
114
|
+
common:
|
115
|
+
# 更新時/参照時で共有の設定
|
116
|
+
...
|
117
|
+
|
118
|
+
例えば,以下のようになります.
|
119
|
+
|
120
|
+
common:
|
121
|
+
sid: S-1-5-21-915876905-2926214379-2876160357
|
122
|
+
base: dc=samba,dc=local,dc=net
|
123
|
+
host: localhost
|
124
|
+
method: :tls
|
125
|
+
|
126
|
+
update:
|
127
|
+
bind_dn: cn=admin,dc=local,dc=net
|
128
|
+
password: admin
|
129
|
+
|
130
|
+
reference:
|
131
|
+
allow_anonymous: true
|
132
|
+
|
133
|
+
passwordはbind.yamlや*.bindに記述するとよいでしょう.
|
134
|
+
|
135
|
+
baseは必ず設定してください.また,sidも設定しておくとよいで
|
136
|
+
しょう.sidの値は以下のコマンドで確認できます.
|
137
|
+
|
138
|
+
% sudo net getlocalsid
|
139
|
+
|
140
|
+
sidを設定しておかないと,毎回net getlocalsidをするため,効率
|
141
|
+
が悪くなります.
|
142
|
+
|
143
|
+
==== 設定ファイルのオプション
|
144
|
+
|
145
|
+
設定可能なオプションは以下の通りです.
|
146
|
+
|
147
|
+
: base
|
148
|
+
ActiveLdap::Base.establish_connectionのオプションと同じ.
|
149
|
+
: host
|
150
|
+
ActiveLdap::Base.establish_connectionのオプションと同じ.
|
151
|
+
: port
|
152
|
+
ActiveLdap::Base.establish_connectionのオプションと同じ.
|
153
|
+
: scope
|
154
|
+
ActiveLdap::Base.establish_connectionのオプションと同じ.
|
155
|
+
: bind_dn
|
156
|
+
ActiveLdap::Base.establish_connectionのオプションと同じ.
|
157
|
+
: password
|
158
|
+
ActiveLdap::Base.establish_connectionのオプションと同じ.
|
159
|
+
: method
|
160
|
+
ActiveLdap::Base.establish_connectionのオプションと同じ.
|
161
|
+
: allow_anonymous
|
162
|
+
ActiveLdap::Base.establish_connectionのオプションと同じ.
|
163
|
+
|
164
|
+
: sid
|
165
|
+
SambaサーバのSID(Security Identifier).
|
166
|
+
: smb_conf
|
167
|
+
Sambaの設定ファイルsmb.confがあるパス.
|
168
|
+
: samba_domain
|
169
|
+
Sambaサーバのドメイン
|
170
|
+
: samba_netbios_name
|
171
|
+
SambaサーバのNetBIOS名
|
172
|
+
|
173
|
+
: password_hash_type
|
174
|
+
LDAP上のパスワードをハッシュ化する時に使用するアルゴリズ
|
175
|
+
ム.指定できるのは:crypt, :md5, :smd5, :sha, :sshaで,デ
|
176
|
+
フォルトは:sshaです.
|
177
|
+
|
178
|
+
LDAP上のパスワードはSambaの認証時ではなく,UNIX上のユーザ
|
179
|
+
の認証時に利用されます.
|
180
|
+
|
181
|
+
: users_suffix
|
182
|
+
LDAP上のユーザエントリを格納するツリー.baseからの相対パ
|
183
|
+
スを指定する.例: ou=Users
|
184
|
+
: groups_suffix
|
185
|
+
LDAP上のグループエントリを格納するツリー.baseからの相対パ
|
186
|
+
スを指定する.例: ou=Groups
|
187
|
+
: computers_suffix
|
188
|
+
LDAP上のコンピュータエントリを格納するツリー.baseからの相対パ
|
189
|
+
スを指定する.例: ou=Computers
|
190
|
+
: idmap_suffix
|
191
|
+
LDAP上のidmapエントリを格納するツリー.baseからの相対パ
|
192
|
+
スを指定する.例: ou=Idmap
|
193
|
+
|
194
|
+
: start_uid
|
195
|
+
新しいユーザを作ったときに,はじめに使用するUID(User
|
196
|
+
Identifier).以降のUIDは1ずつ増えていく.デフォルトは
|
197
|
+
10000.
|
198
|
+
|
199
|
+
: start_gid
|
200
|
+
新しいユーザを作ったときに,はじめに使用するGID(Group
|
201
|
+
Identifier).以降のGIDは1ずつ増えていく.デフォルトは
|
202
|
+
10000.
|
203
|
+
|
204
|
+
: user_login_shell
|
205
|
+
新しく作成したユーザのログインシェル.デフォルトは
|
206
|
+
/bin/false.
|
207
|
+
: user_home_directory
|
208
|
+
新しく作成したユーザのホームディレクトリ.%Uはユーザ名に
|
209
|
+
置換される.デフォルトは/home/%U.
|
210
|
+
: user_home_directory_mode
|
211
|
+
ユーザのホームディレクトリを作成する際に設定するパーミッ
|
212
|
+
ション用のモード.デフォルトは0755(8進数).
|
213
|
+
|
214
|
+
: user_gecos
|
215
|
+
ユーザのGECOSフィールドの値.%Uはユーザ名に置換される.
|
216
|
+
|
217
|
+
: user_home_unc
|
218
|
+
Windowsから見たときのユーザのホームへのパス.
|
219
|
+
UNC(Universal Naming Convention)で記述する.%Uはユーザ名
|
220
|
+
に置換される.デフォルトは\\SambaサーバのNetBIOS名\%U.
|
221
|
+
|
222
|
+
: user_profile
|
223
|
+
ユーザプロファイルへのパス.
|
224
|
+
UNC(Universal Naming Convention)で記述する.%Uはユーザ名
|
225
|
+
に置換される.デフォルトは\\SambaサーバのNetBIOS名\profiles\%U.
|
226
|
+
|
227
|
+
: user_home_drive
|
228
|
+
ユーザのホームを割り当てるドライブ名.デフォルトはH:.
|
229
|
+
|
230
|
+
: user_logon_script
|
231
|
+
ユーザがログオンしたときに実行するスクリプトファイル名.
|
232
|
+
デフォルトはlogon.bat.
|
233
|
+
|
234
|
+
# : mail_domain
|
235
|
+
|
236
|
+
: skeleton_directory
|
237
|
+
ユーザのホームディレクトリを作成する時に雛型とするディレ
|
238
|
+
クトリ.デフォルトは/etc/skel.
|
239
|
+
|
240
|
+
: default_user_gid
|
241
|
+
デフォルトでユーザが所属するグループ.デフォルトはDomain
|
242
|
+
Usersグループ.
|
243
|
+
|
244
|
+
: default_computer_gid
|
245
|
+
デフォルトでコンピュータが所属するグループ.デフォルトは
|
246
|
+
Domain Computersグループ.
|
247
|
+
|
248
|
+
# : default_max_password_age
|
249
|
+
|
250
|
+
==== 初期化
|
251
|
+
|
252
|
+
asl-*を用いてSamba + LDAP環境を管理する前に,一度だけ
|
253
|
+
asl-populateを起動してLDAPサーバに基本的なエントリを追加しま
|
254
|
+
す.
|
255
|
+
|
256
|
+
% sudo asl-populate
|
257
|
+
|
258
|
+
もし,root権限が無くても実行できるのであれば以下のようにする
|
259
|
+
とよいでしょう((-root権限チェックは必要ないかもしれない-)).
|
260
|
+
|
261
|
+
% fakeroot asl-populate
|
262
|
+
|
263
|
+
==== 管理
|
264
|
+
|
265
|
+
コマンドラインからはasl-user*, asl-group*, asl-populate,
|
266
|
+
asl-purge, asl-passwordを使って管理してください.各コマンド
|
267
|
+
の使いかたは--helpオプションを参考にしてください.
|
268
|
+
|
269
|
+
==== smb.confの設定
|
270
|
+
|
271
|
+
((<Srvtools|URL:http://support.microsoft.com/kb/173673/>))を
|
272
|
+
使ってWindowsからユーザ管理を行いたい場合は,また,Sambaをド
|
273
|
+
メインコントローラとして動作させたい場合は,以下のように
|
274
|
+
smb.confを設定します.ここでは,asl-samba-*を使います.
|
275
|
+
|
276
|
+
(ドメインコントローラとして動作させるけど,Srvtools でユー
|
277
|
+
ザ管理を行わない場合はadd machine script以外のなんとかscript
|
278
|
+
は設定しなくてもよい気がする.)
|
279
|
+
|
280
|
+
passdb backend = ldapsam:ldap://127.0.0.0
|
281
|
+
ldap admin dn = cn=admin,dc=local,dc=net
|
282
|
+
ldap suffix = dc=samba,dc=local,dc=net
|
283
|
+
ldap user suffix = ou=Users
|
284
|
+
ldap group suffix = ou=Groups
|
285
|
+
ldap machine suffix = ou=Computers
|
286
|
+
ldap idmap suffix = ou=Idmap
|
287
|
+
ldap passwd sync = yes
|
288
|
+
|
289
|
+
admin users = "@Domain Admins"
|
290
|
+
add user script = /.../asl-samba-useradd "%u"
|
291
|
+
delete user script = /.../asl-samba-userdel "%u"
|
292
|
+
add group script = /.../asl-samba-groupadd "%g"
|
293
|
+
delete group script = /.../asl-samba-groupdel "%g"
|
294
|
+
add user to group script = /.../asl-samba-groupmod "%g" --add-members "%u"
|
295
|
+
delete user from group script = /.../asl-samba-groupmod "%g" --delete-members "%u"
|
296
|
+
set primary group script = /.../asl-samba-usermod "%u" --gid "%g"
|
297
|
+
add machine script = /.../asl-samba-computeradd "%u"
|
298
|
+
|
299
|
+
Sambaを起動する前に,以下を実行してldap admin dnで指定した
|
300
|
+
LDAP管理ユーザのパスワードを設定しておく必要があります.
|
301
|
+
|
302
|
+
% sudo /usr/bin/smbpasswd -W
|
303
|
+
|
304
|
+
== トラブルシューティング
|
305
|
+
|
306
|
+
|
307
|
+
== 感謝
|