barus's diary

とても真面目なblogですにゃ

centos7でのsambaの設定

windows10とcentos7(Linux)のファイル共有メモ。

  centos7の/shareフォルダを共有する。

f:id:hatakeka:20191208093826p:plain

 windows10側

   wifiの接続のプロパティよりprivateにする。

f:id:hatakeka:20191208091949p:plain

  • centos7

       前提条件

  ・centos7のネットワークの設定が済んでいる。

  ・sambaがインストールされているものとする。

          yum install samba samba-client samba-common -y

  ・作業はsuで行う。

 

 

 

 

 

 

 

 

 

1."/etc/samba/smb.conf"の編集
※globalとshareの設定のところ

f:id:hatakeka:20191208093620p:plain

 
パラメータのチェック

[root@centos7 /]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[share]"
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

/shareの作成
    # cd /
    # mkdir share
  # chmod -R 777 share/
  # chown -R nobody:nobody share
sambaのrestart
再起動
[root@centos7 /]# systemctl restart smb.service
[root@centos7 /]# systemctl restart nmb.service
ファイアウォールの設定
# firewall-cmd --permanent --zone=public --add-service=samba
# firewall-cmd --reload

# chcon -t samba_share_t /share

 
sambaを次回から自動起動
# systemctl enable smb.service
# systemctl enable nmb.service


//設定が有効になっているか、再起動してみて
#reboot

//sambaの確認
[root@centos7 /]# systemctl is-active smb.service
active
[root@centos7 /]# systemctl is-active nmb.service
active

tmp
start.
テンプレート
end. 

 

 

 

 

 

 

 

 

参考url:

https://www.atmarkit.co.jp/ait/articles/1612/01/news184.html

https://orebibou.com/2014/12/centos7%E3%81%ABsamba%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/

 

 

 

 

 

 

 

 

 

 

 

 

 2."/etc/samba/smb.conf"の編集