====== Samba のインストール ======
===== Samba のインストール =====
# yum install -y samba
===== Samba 用のフォルダ作成 =====
最初に共有するフォルダを作成します。
# mkdir /home/samba
# mkdir /home/samba/public
# chown -R nobody:nobody /home/samba
# chmod 777 -R /home/samba
===== Samba の設定 =====
設定ファイルのバックアップ
# cp /etc/samba/smb.conf /etc/samba/smb.conf.org
# 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 = WORKGROUP
	security = user
	passdb backend = tdbsam
	printing = cups
	printcap name = cups
	load printers = yes
	cups options = raw
	# Windows 側の文字コード
	dos charset = CP932
	# Linux 側の文字コード
	unix charset = UTF-8
	# 表示文字コード
	display charset = UTF-8
	# マイネットワークに表示
	browsable = yes
	# 登録されていないユーザもアクセス許可
	map to guest = bad user
	# ゲストアカウントを nobody へマッピング
	guest account = nobody
#[homes]
#	comment = Home Directories
#	valid users = %S, %D%w%S
#	browseable = No
#	read only = No
#	inherit acls = Yes
#[printers]
#	comment = All Printers
#	path = /var/tmp
#	printable = Yes
#	create mask = 0600
#	browseable = No
#[print$]
#	comment = Printer Drivers
#	path = /var/lib/samba/drivers
#	write list = root
#	create mask = 0664
#	directory mask = 0775
[public]
	# パス
	path = /home/samba/public
	# フォルダの説明
	comment = Public Directories
	# ゲストアクセス許可
	guest ok = yes
	# 書き込み許可
	writable = yes
	# ファイル作成時のパーミッション
	force create mode = 0666
	# ディレクトリ作成時のパーミッション
	force directory mode = 0777
samba の起動と、samba  を自動起動に設定します。 
# systemctl restart smb.service
# systemctl restart nmb.service
# systemctl enable smb.service
# systemctl enable nmb.service