samba

Table of Contents

Sambaでファイルサーバの構築

インストール

# dnf install samba

共有フォルダの用意

# mkdir /home/move
# chmod 0777 /home/move/
# chown hoge:hoge /home/move/

ユーザ登録

# smbpasswd -a hoge

設定

# cp /etc/samba/smb.conf /etc/samba/smb.conf.org
# vi /etc/samba/smb.conf
--------------------------------------------------------------------------
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
        workgroup = chinaz
        server string = SAMBA SERVER Version %v
        netbios name = sv
        security = user
        map to guest = Bad User
        guest account = hoge

        passdb backend = tdbsam

        load printers = No
        log level = 2
        log file = /var/log/samba/log.%m
        max log size = 1024

[doc]
        path = /home/hoge/doc
        browsable = Yes
        guest ok = Yes
        guest only = Yes
        writable = Yes
        create mask = 0664
        directory mask = 0777

[move]
        path = /home/move
        browsable = Yes
        guest ok = Yes
        guest only = Yes
        writable = Yes
        create mask = 0664

[web]
        path = /home/www/html
        browsable = Yes
        guest ok = Yes
        writable = Yes
        read only = No
        force user = root
        force group = root
        create mask = 0664

[映画]
        comment = 映画
        path = /home/move/映画
        read only = Yes
        guest ok = Yes
--------------------------------------------------------------------------

構文チェック

# testparm

起動設定

# systemctl start smb
# systemctl start nmb
# systemctl enable smb
# systemctl enable nmb

再起動

# systemctl restart smb nmb

ポートのオープン

# firewall-cmd --zone=internal --add-service=samba --permanent
# firewall-cmd --reload
# firewall-cmd --list-all-zones

"Could not find child xxxx — ignoring"

smb.conf の [global] セクションに以下を追記。

printcap cache time = 0

参考URL
Samba の Error 文言の対処法いくつか – 元RX-7乗りの適当な日々

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です