sambaのインストール

# yum install samba

全ユーザがアクセスできる共有ディレクトリの作成

# mkdir /home/share
# chmod 777 /home/share

smb.confの設定

# vi /etc/samba/smb.conf

[global]
    unix charset = UTF-8
    dos charset = CP932

    workgroup = WORKGROUP
    server string = Samba Server Version %v
    # 任意のコンピュータ名を指定
    netbios name = LOLLIPOP
    # 必要に応じて、接続許可するIPを指定
    # 127. 192.168. にすると、
    # ローカルホストもしくは 192.168.*.* からつながる
    hosts allow = 127. 192.168.
    max protocol = SMB2

    # プリンタの共有は使わないので無効に
    load printers = no
    disable spoolss = yes
    # ログ保存の設定
    log file = /var/log/samba/log.%m
    max log size = 1000

    security = user
    passdb backend = tdbsam
    map to guest = Never

[home]
    # ログインユーザのホームディレクトリにアクセスできるようにする設定
    comment = Home Directories
    browseable = yes
    writable = yes

[share]
    # 全ユーザがアクセスできる共有ディレクトリの設定
    comment = Public Stuff
    path = /home/share
    public = yes
    writable = yes
    guest ok = no
    create mode = 0777
    directory mode = 0777

SELinux有効の場合は、以下を実行しておく

# setsebool -P samba_domain_controller on
# setsebool -P samba_enable_home_dirs on
# setsebool -P samba_export_all_rw on

firewallの設定

# firewall-cmd --add-port=137/udp --permanent
# firewall-cmd --add-port=138/udp --permanent
# firewall-cmd --add-port=139/tcp --permanent
# firewall-cmd --add-port=445/tcp --permanent

ユーザごとに、samba用のパスワードを設定

# smbpasswd -a ユーザ名
New SMB password: パスワードを入力(画面には何も表示されない)
Retype new SMB password: もう一度
Added user ユーザ名.

sambaをサービスとして登録、起動

# systemctl enable smb.service
# systemctl enable nmb.service
# systemctl start smb.service
# systemctl start nmb.service

これで、Windowsからアクセスできるようになるはず…!