忘れがちなことを、つらつらと...

俺的備忘録を公開してみるテスト

CentOS 6.5 に intra-mart をインストールしたときのメモ(その後)

外部アクセスに関する設定など思い出したら書く。

ストレージをWindowsからアクセスする設定

  • Sambaのインストール
# yum install samba
  • アクセス用Linuxユーザの作成
# useradd -s /bin/false imart
  • Directoryの作成
# mkdir -p /tmp/storage
  • アクセス用Sambaユーザの設定
# pdbedit -a imart
new password:
retype new password:
# vi /etc/samba/smb.conf

一部抜粋
#======================= Global Settings =====================================

[global]

unix charset = UTF-8 ← 追記
dos charset = CP932 ← 追記

force user = root ← 追記(とりあえずrootでw)

# ----------------------- Network Related Options -------------------------
#

一部抜粋
;       interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
        hosts allow = 127. 192.168.0. ← アクセス元を追記

# --------------------------- Logging Options -----------------------------

最後に追加
[imart]
        comment = imart storage directory
        path = /tmp/storage
        public = no
        valid users = imart
        writable = yes
        browseable = yes
        create mask = 0777
        create mode = 0777
        directory mode = 0777
        share modes = yes
# chkconfig smb on
# service smb start

firewallの設定

# vi /etc/sysconfig/iptables

一部抜粋
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT  ← 追記
-A INPUT -m state --state NEW -m udp -p udp --dport 137:138 -j ACCEPT  ← 追記
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT  ← 追記
-A INPUT -j REJECT --reject-with icmp-host-prohibited

# service iptables reload
</pre> 
- SELinuxでSambaを許可する
<pre class="lang:default decode:true " >
# getsebool samba_enable_home_dirs
samba_enable_home_dirs --> off
# setsebool -P samba_enable_home_dirs 1
# getsebool samba_enable_home_dirs
samba_enable_home_dirs --> on