centos8にsambaをインストール・設定

[root@centos8-test ~]# dnf install -y samba

 

dnfコマンドを使ってパッケージをインストール

 

 sambaの設定ファイルの編集

 (sambaの設定ファイルは /etc/samba/smb.conf)

 

[root@centos8-test ~]# vi /etc/samba/smb.conf

 

 [global]
  workgroup = WORKGROUP
  security = user


  map to guest = bad user

  printing = cups
  printcap name = cups
  load printers = yes
  cups options = raw

 
  unix charset = UTF-8
  dos charset = CP932

 

 [share]
  #共有フォルダの場所
  path = /home/share
  #マイネットワークに表示の有無
  browseable = yes
  #書き込み許可
  writable = yes
  #ゲストユーザのログイン許可
  guest ok = yes
  #読込みの許可
  read only = no

 

samba設定ファイル編集後、

共有フォルダを作成

[root@centos8-test ~]# mkdir /home/share

 

作成したフォルダのアクセス権を変更

[root@centos8-test ~]# chmod -R 0777 /home/share

 

作成したフォルダのユーザー:グループを変更

[root@centos8-test ~]# chown nobody:nobody /home/share

 

SELinuxの無効化 ※しない方がいい。

[root@centos8-test ~]# setenforce 0

 

firewallを有効にしている場合は、サービスの追加

[root@centos8-test ~]# firewall-cmd --add-service=samba --permanent

[root@centos8-test ~]# firewall-cmd --reload

 

windows側で確認

エクスプローラーで[\\centos8のipアドレス]で検索

f:id:Tryota:20200617223629p:plain