- 追加された行はこの色です。
- 削除された行はこの色です。
*Samba3 [#q54a4bc1]
RIGHT:更新日 &lastmod();
**ファイル共有 [#n08113e6]
***インストール [#j77a69c5]
# apt-get install samba
***設定 [#z45306d5]
/etc/samba/smb.cofで最低以下を設定
[global]
# charset (euc-jp)
unix charset = eucJP-ms
dos charset = cp932
display charset = eucJP-ms
workgroup = ISM
server string = ism samba
server string = ismsamba <-- ホスト名(\\ismsamba\)
security = user <-- /etc/samba/smbpasswdのユーザを使用(普通これを選択)
''文字コード''
unix charset UNIX側での文字コードの設定(eucJP-ms UTF-8)
dos charset Windows側での文字コードの設定。日本語を利用する場合は、CP932
display charset swat で表示される文字コードの指定
''samba.confのチェック''
# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[sambadoc]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
***起動 [#i81500b1]
# /etc/rc.d/init.d/smb start
***ユーザ登録 [#u4ee830f]
ユーザはlinuxアカウントを事前に登録しておく必要がある
smb.cofで以下がコメントアウトのとき~
; passdb backend = tdbsam~
''/etc/passwdファイルからsmbpasswdを作成''~
ファイルは作成されるがパスワードは作成されないので注意すること。あとからか作成する。
# cd /etc/samba
# /usr/bin/mksmbpasswd.sh < /etc/passwd > smbpasswd
注)mksmbpasswd.shに実行件がないときは追加する
''パスワード作成''~
# /usr/bin/smbpasswd okada
New SMB password: ******
Retype new SMB password: ******
また、新しいユーザを追加sたときはlinuxアカウントを発行して(/sbin/nologinでもいいみたい)smbpasswdに以下ように同じように行を追加して/usr/bin/smbpasswd でパスワードを作成する
/etc/samba/smbpasswd
#
# SMB password file.
#
okada:500:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:[U ]:
LCT-47725CAF:Okada
admin:502:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:[U ]:
LCT-477273B8:
vmwinxp$:503:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:[W
]:LCT-47727365:
注)$がついているのはマシン名
***Windowsから [#s2fd7b61]
ネットワークから 「\\(IPアドレス)\」でアクセスこのときWindowsのユーザも上記で設定したユーザ、パスワードでアクセスする
**SambaでPDC [#ycac8090]
''/etc/samba/smb.conf''
[global]
workgroup = ISM <--(1)
server string = ism samba
security = user
local master = yes
os level = 65 <--32より大きくする
domain master = yes
preferred master = yes
domain logons = yes
logon path = \\%L\Profiles\%U
;logon path = \\%L\Profiles\%U
logon path = <--移動プロファイルを使用しなときは明示てきにこのように指定する
netbios name = MYNAME
logon drive = H:
logon home = \\homeserver\%u\winprofile
admin users = administrator <--このアカウントでWindows側をドメインに参加させる(2)
[homes]
comment = %U's Home Directory
browseable = no
writable = yes
; create mask = 0644
; directory mask = 0755
[netlogon]
path = /var/samba/netlogon
read only = yes
write list = ntadmin
[Profiles]
/var/samba/profiles
read only = no
create mask = 0600
directory mask = 0700
[global]で「passdb backend = tdbsam」と指定するとパスワードが/etc/samba/passdb.tdbのようなバイナリファイルに保存され、パスワードファイルがsmbpasswdではなくなる。このときは以下のようにユーザ追加を行うが通常はこのオプションは無効にして、テキストファイル(smbpasswd)であつかったほうか簡単?(セキュリティ的には無視すれば)
# /usr/sbin/useradd admin
# pdbedit -a -u admin
params.c:Parameter() - Ignoring badly formed line in configuration
file: /var/samba/profiles
new password: *******
retype new password: ********
Unix username: admin
NT username:
Account Flags: [U ]
User SID: S-1-5-21-2947849931-3299972202-1454051791-2004
Primary Group SID: S-1-5-21-2947849931-3299972202-1454051791-513
Full Name:
Home Directory: \\homeserver\admin\winprofile
HomeDir Drive: H:
Logon Script:
Profile Path: \\localhost\Profiles\admin
Domain: ISM
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 火, 19 1月 2038 12:14:07 JST
Kickoff time: 火, 19 1月 2038 12:14:07 JST
Password last set: 水, 26 12月 2007 23:48:21 JST
Password can change: 水, 26 12月 2007 23:48:21 JST
Password must change: 火, 19 1月 2038 12:14:07 JST
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
''マシンの追加''~
PDCが接続許可するマシンを追加する。&color(red){マシン名の後は$を必ずつける。};
# /usr/sbin/useradd vmwinxp$
# pdbedit -a -m vmwinxp
params.c:Parameter() - Ignoring badly formed line in configuration
file: /var/samba/profiles
Unix username: vmwinxp$
NT username:
Account Flags: [W ]
User SID: S-1-5-21-2947849931-3299972202-1454051791-2006
Primary Group SID: S-1-5-21-2947849931-3299972202-1454051791-513
Full Name:
Home Directory:
HomeDir Drive: (null)
Logon Script:
Profile Path:
Domain: ISM
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 火, 19 1月 2038 12:14:07 JST
Kickoff time: 火, 19 1月 2038 12:14:07 JST
Password last set: 水, 26 12月 2007 23:50:38 JST
Password can change: 水, 26 12月 2007 23:50:38 JST
Password must change: 火, 19 1月 2038 12:14:07 JST
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
''ユーザ(マシン)削除''
# pdbedit -x -u okada2
''ユーザ(マシン)表示''
# pdbedit -L
params.c:Parameter() - Ignoring badly formed line in configuration
file: /var/samba/profiles
VMWINXP$:4294967295:VMWINXP$ <==マシン
administrator:504:
**Windowsの設定 [#y7697c03]
「マイコンピュータ」右クリック ->「システムプロパティ」->~
コンピュータ名の変更でドメインを(1)で指定したWorkGroupを、~
ユーザを(2)で指定したユーザ、パスワードで行う。
その後再起動