LoginSignup
0
0

More than 5 years have passed since last update.

CentOS > SMB

Last updated at Posted at 2017-11-26

Samba

install

# yum -y install samba
mkdir /home/samba

chmod 777 /home/samba
cp /etc/hosts /home/samba
nano /etc/samba/smb.conf


useradd username
passwd username
pdbedit -a username

chown username /home/$user/samba

smb.confの編集

vi /etc/samba/smb.conf


[global]
    workgroup = WORKGROUP
    catia:mappings = 0x22:0xa8,0x2a:0xa4,0x2f:0xf8,0x3a:0xf7,0x3c:0xab,0x3e:0xbb,0x3f:    0xbf,0x5c:0xff,0x7c:0xa6
    vfs objects = catia
    dos charset = CP932
    unix charset = UTF-8
    hosts allow = xxx.xxx.xxx.xxx.
    read only = no
    mangled names = no


[homes]

  # /home/ユーザー名/sambaをホームディレクトリにする
    path = %H/samba

    # Windows側から見た時に付加されるコメント
    comment = %U's Home directory

    # Windowsの共有一覧にホームディレクトリを表示するか
    browseable = No

    # 読み出しのみ可能か
    read only = No

    # 書き込みを許可する
    writable = Yes

    # ファイルにはこのアクセス権(644)が付与される
    create mode = 0644

    # ディレクトリにはこのアクセス権(775)が付与される
    directory mode = 0775

smbの起動と再起動

初回はstart, 以後はrestart

systemctl start smb
systemctl start nmb

以後はrestart

systemctl restart smb
systemctl restart nmb

Samba自動起動設定

# systemctl enable smb
# systemctl enable nmb
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0