TOP ▲
itcore TOP
> TIPS
> samba.php
タグ:samba ubuntu
itcore TOP TIPS
Ubuntu samba設定 | itcore 2016
sudo -s
# sambaをインストール
apt-get -y install samba
# ファイアーウォールにポート許可追加
ufw allow 139
ufw allow 445
# 共有フォルダの作成
mkdir -p /home2/share
chmod 777 /home2/share
cp -ip /etc/samba/smb.conf /etc/samba/smb.conf_`date "+%Y%m%d"`
vi /etc/samba/smb.conf
:25
[global]
unix charset = UTF-8
dos charset = CP932
security = user
:54
interfaces = 127.0.0.0/8 10.0.0.0/24
:125
# map to guest = bad user
:$
[share]
path = /home2/share
writable = yes
guest ok = no
guest only = no
create mode = 0770
directory mode = 0770
valid users = @share
:wq
# samba 設定読み込み
/etc/init.d/samba reload
# samba 再起動(参考)
/etc/init.d/samba stop
/etc/init.d/samba start
# アカウント作成
useradd -m yamada
pdbedit -a yamada
パスワード入力
# グループ作成
groupadd share
chgrp -R share /home2/share
chmod -R 2770 /home2/share
# グループへのアカウント参加
gpasswd -a yamada share
# windowsから
\\10.0.0.24

# 共有フォルダが表示される。

共有フォルダの下にファイルを作成するなどして書き込みできるか確認する。
