非常に不便
まずはsambaとftpサーバを入れる
①samba
sambaはwindowsからアクセスできるファイル共有のためのサーバソフトウェア。
a)インストール
yum install samba
b)設定1
まずはlinuxのユーザを作成し、それをsambaユーザに登録する
pdbedit -a ***(ユーザ名)
new password:
retype new password:
new password:
retype new password:
c)共有ディレクトリ作成
mkdir /home/***/samba
mkdir /data/samba
mkdir /data/samba
d)設定2
vi /etc/samba/smb.conf
e)sambaの起動
/etc/init.d/smb start
/etc/init.d/nmb start
chkconfig smb on
chkconfig nmb on
/etc/init.d/nmb start
chkconfig smb on
chkconfig nmb on
f)テストしてみる
windows端末でアクセスしてみたら、フォルダが表示されるが、中身にアクセスできない
(アクセス拒否)
原因はftpインストールのあと述べる
②ftpサーバ
sambaはうまく行かないので、せめてftpだけをつか
vsftpdを使わせていただく
a)インストール
yum install vsftpd
b)設定
c)テスト
NASからテストしてみると、接続が出来たが、サーバ側のファイルリスト(ls)及びファイル伝送はできない
(sambaと似たような現象)
■ 上記のsambaとftpのアクセス拒否について調べると、すべてSeLinuxのせいだということが分かった。
そもそもSELnuxとは何者なのか
SELinux - Security-Enhanced Linux
Linuxカーネル用のセキュリティ拡張機能である
仕組みはちょっと複雑みたいが、とりあえず「permissive」モードと「enforcing」モードがあり、permissiveモードにすればOK
現在のモードの確認
#getenforce
Enforcing
permissiveへ変更
#setenforce 0
確認
#getenforce
Permissive
Permissive
これでsambaとftpのアクセスがうまく出来だが、このままだとサーバを再起動すると、モードが戻ってしまうので、設定ファイルを修正する必要がある
以下の通り
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# d isabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# d isabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
0 コメント:
コメントを投稿