Calender
Sun Mon Tue Wed Thu Fri Sat
      1
2345678
9101112131415
16171819202122
23242526272829
30      
<< September 2018 >>
広告
SEARCH

SELECTED ENTRIES
RECENT COMMENTS
RECENT TRACKBACK
CATEGORIES
ARCHIVES
LINKS
PROFILE
OTHERS
SKYPE
PC: skype.jojo.jp
chat
iPad: iphone.jojo.jp
chat call
THANKS



本日:
昨日:
多言語
広告
 ▼▲ 作業日報 ▼△
    What's under the hood?
<< YouTube | main | SSHなトンネル >>
smb.conf 共有名での日本語の利用_サンバ
10/01/20追記:
 Debian5で頒布されているsambaパッケージは日本語に依存する設定は必要ないようです
 →現在の設定サンプル
共有名に日本語を利用したいなと思いしらべていたら、、

 samba3になってからsmb.confの構造がかなり変わっているらしい。文字化け等の問題がなかったので気づかなかった。
#client code page = 932 ....samba3系ではNG
#coding system = HEX ........samba3系ではNG
unix charset = EUC-JP ......ファイルシステム文字コード
dos charset = cp932 ........Windows側の文字コード
display charset = EUC-JP ..........SWATで用いる文字コード

 以前共有名に全角を使う場合は coding system=HEXとし、[:xx:xx:xx]と文字コードを記述していたらしいが、現在では普通に下の文字コード設定であればEUCで編集することでsmb.confの「unix charset」と同一の文字コードで編集することで全角文字も利用できた

OBS266J:/usr/local/samba# cat ./lib/smb.conf
[global]
#    client code page = 932
#    coding system = HEX
    unix charset = EUC-JP
    dos charset = cp932
    display charset = EUC-JP
    interfaces = eth1
    netbios name = OBS266
    workgroup = workgroup
    encrypt passwords = Yes
    map to guest = Bad User
    log file = /var/log/samba/samba-log.%m
    lock directory = /var/lock/samba
    guest account = guest
#    hosts allow = 192.168.1.
    server string = Samba %v (for %m)
    security =user
    username map=/usr/local/samba/lib/samba.map
#    vfs objects = recycle
    hide unreadable = yes
    kernel oplocks = no
    load printers = no
    disable spoolss = yes
[homes]
    comment= ホームディレクトリ
    browseable = no
    hide dot files = yes
    path = /home/%S
    writable = Yes
    guest ok = No
    create mode = 644
    directory mode = 755
    level2 oplocks = No
#    recycle:repository = .recycle/%u
#    recycle:keeptree = yes
#    recycle:touch = yes
#    recycle:version = yes
#    recycle:maxsize = 0
#    recycle:exclude = *.tmp
#    recycle:exclude_dir = /tmp/cache
[ログ]
    comment= 通信ログ
    path = /home/hoge/capt
    writable = Yes
    guest ok = Yes
    level2 oplocks = No
[ログ整理済]
    comment=過去のログファイルです
    path = /home/hoge/capt/done
    writable = Yes
    guest ok = Yes
    level2 oplocks = No

[一時]
#[tmp]
    path = /tmp
    writable = Yes
    guest ok = Yes
    level2 oplocks = No

[アプリケーション]
    path=/home/suzu
    writable = Yes
    guest ok = No
    level2 oplocks = No


OBS266J:/usr/local/samba#./bin/testparm
Load smb config files from /usr/local/samba/lib/smb.conf
Processing section "[homes]"
Processing section "[ログ]"
Processing section "[ログ整理済]"
Processing section "[一時]"
Processing section "[アプリケーション]"
Loaded services file OK.
WARNING: You have some share names that are longer than 12 characters.
These may not be accessible to some older clients.
(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

# Global parameters
[global]
    dos charset = cp932
    unix charset = EUC-JP
    display charset = EUC-JP
    netbios name = OBS266
    server string = Samba %v ()
    interfaces = eth1
    map to guest = Bad User
    guest account = guest
    username map = /usr/local/samba/lib/samba.map
    log file = /var/log/samba/samba-log.%m
    lock directory = /var/lock/samba
    hide unreadable = Yes

[homes]
    comment = ホームディレクトリ
    path = /home/%S
    read only = No
    create mask = 0644
    guest ok = Yes
    browseable = No
    level2 oplocks = No

[ログ]
    comment = 通信ログ
    path = /home/hoge/capt
    read only = No
    guest ok = Yes
    level2 oplocks = No

[ログ整理済]
    comment = 過去のログファイルです
    path = /home/hoge/capt/done
    read only = No
    guest ok = Yes
    level2 oplocks = No

[一時]
    path = /tmp
    read only = No
    guest ok = Yes
    level2 oplocks = No

[アプリケーション]
    path = /home/suzu
    read only = No
    level2 oplocks = No


OBS266J:/usr/local/samba#./sbin/smbd -iS
smbd version 3.0.5 started.
Copyright Andrew Tridgell and the Samba Team 1992-2004
Failed to setup RT_SIGNAL_LEASE handler
viしかなかったので日本語の入力はsmb.confを見える場所へ移動して秀丸で行いましたリンクするが吉

なんか最後に変なエラーがでてますなたらーっ
....青部分を追加
ログに下のエラーを出していたので、、
[2007/11/06 18:03:51, 0] lib/util_sock.c:get_peer_addr(978)
getpeername failed. Error was Transport endpoint is not connected
[2007/11/06 18:03:51, 0] lib/util_sock.c:write_socket_data(413)
 write_socket_data: write failure. Error = Connection reset by peer
[2007/11/06 18:03:51, 0] lib/util_sock.c:write_socket(438)
 write_socket: Error writing 4 bytes to socket 23: ERRNO = Connection reset by peer
[2007/11/06 18:03:51, 0] lib/util_sock.c:send_smb(630)
 Error writing 4 bytes to client. -1. (Connection reset by peer)
....緑部分を追加
smb.conf説明
10/01/20時点でのテンプレート
・Debian5 Samba3.2.5
[global]
   netbios name = sambabox
   workgroup = WORKGROUP
#   unix charset = utf8
#   dos charset = cp932
#   display charset =utf8
#  interfaces = eth1
#  map to guest = Bad User
#  hosts allow = 192.168.1.
   guest account = nobody
   server string = Samba %v (for %m)
   security =user
#  username map=/usr/local/samba/lib/samba.map
#   vfs objects = recycle
   hide unreadable = yes
   kernel oplocks = no
   load printers = no
   disable spoolss = yes
#  lock directory = /var/lock/samba
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter¥snew¥s*¥spassword:* %n¥n
       *Retype¥snew¥s*¥spassword:* %n¥n
       *password¥supdated¥ssuccessfully* .
   pam password change = yes

[homes]
   comment = Home Directories
   browseable = no
   read only = no
   create mask = 0666
   directory mask = 0777
   valid users = %S
[db]
   comment = DB(/home/db)
   path = /var/lib/postgresql/8.2
   force user=postgres
   create mask = 0600
   directory mask = 0700
   read only = no
[etc]
   comment = システム設定(変更注意)
   path = /etc
   force user=root
   create mask = 0644
   directory mask = 0755
   read only = no
[ログ]
   comment = /var(読取専用)
   path = /var
   force user=root
   create mask = 0644
   directory mask = 0755
   read only = yes
| Linux | 12:26 | comments(0) | trackbacks(0) |









http://blog.jojo.jp/trackback/728928