レンタルサーバー・自宅サーバー設定・構築のヒント
レンタルサーバー・自宅サーバー設定・構築のヒント - レンタルサーバー・自宅サーバーの設定・構築情報を公開しています。

評判のABLENET VPSを使うときに最初にやっておきたいこと(CentOS編)

2012年3月6日 2017年8月10日
ablenet vps kvm centos

さくらのVPSの時(評判のさくらのVPSを使うときに最初にやっておきたいこと(CentOS編))や
CloudCore ( クラウドコア ) VPS の時(評判のCloudCore VPSを使うときに最初にやっておきたいこと(CentOS編))や
SPPD VPS の時(評判のSPPD VPSを使うときに最初にやっておきたいこと(CentOS編)) と同じように、ここでは、初期状態のABLENET VPSで、最初になっておきたいことを整理しておきます。

ABLENET VPSは、格安 (¥480 /月) のKVM VPSを提供しているレンタルサーバーです。安いだけあってパワー不足は否めませんが、VPSを初めて扱うなら面白いサーバーです。
ABLENET VPS を試してみたい方は、ABLENET VPS ページABLENET VPS ページからどうぞ。無料お試し期間が10日間あります。

ABLENET VPSのCentOSで最初にやっておきたいこと

ABLENET VPSの場合、申し込んだ後、ABLENET VPSからメールでお知らせが来ると、既にCentOS 5.7 (64bit版) が動作している状態になっています。
( コンビニ決済の場合は、ABLENET VPSから郵送されてきます。 )

そのため、SSHでアクセスすることもできます。
SSHでログインする場合は、ABLENET VPSからのお知らせメールにある初期パスワードを使ってrootでログインすることになります。

ABLENET VPSの場合、自宅サーバーと違って、既に外部に直接つながった状態ですから、まず、セキュリティ面の強化とサーバー設定をする必要があります。

ここでは、CentOSの初期状態から、各サーバー系をインストールする手前までにやることを記述してみます。

CentOSを最新にアップデートする。

現在(2012.03.06)では、デフォルトのCentOS のバージョンは、5.7 (64bit版) となります。
これを最新へアップデートしておきましょう。
( 2012.03.06に実際にupdateを実施したとき、最新状態となっていて更新するものはありませんでした。更新するものは無いかもしれませんが、確認も含めてやっておきましょう。 )

$ cat /etc/redhat-releasereturn
CentOS release 5.7 (Final)

$ yum updatereturn
..

Install       1 Package(s)
Upgrade     118 Package(s)

Total download size: 202 M
Is this ok [y/N]: yreturn

..

  xulrunner-devel.x86_64 0:1.9.2.26-2.el5_7

Complete!

$ cat /etc/redhat-releasereturn
CentOS release 5.7 (Final)

ここでは、まず、現在のCentOSのバージョンを確認した後、yum updateでシステムのアップデートを実施しています。

更新するものが何も無い場合は、以下のように出力されるでしょう。

$ yum updatereturn
Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile
 * base: www.ftp.ne.jp
 * extras: www.ftp.ne.jp
 * updates: www.ftp.ne.jp
Setting up Update Process
No Packages marked for Update

iptables , vimをインストールする。

iptables , vim ともインストール済のはずなので、以下の作業は必要ないはずです。
以下のようにインストール済か確認しておきましょう。

$ rpm -qa|grep iptablesreturn
iptables-1.3.5-5.3.el5_4.1
iptables-ipv6-1.3.5-5.3.el5_4.1
$ rpm -qa|grep vimreturn
vim-minimal-7.0.109-7.el5
vim-enhanced-7.0.109-7.el5
vim-common-7.0.109-7.el5
iptables , vim-enhanced がインストールされていればOKです。

もしインストールされていないようなら、以下の手順でインストールしておきましょう。

iptables は、LinuxでIPマスカレードおよびパケットフィルタリングを実施するソフトウェアです。
vim は、多言語に対応した テキストエディタ ( vi ) です。

標準のviエディタでも良いのですが、日本語の入力が楽な面もありますし、使い勝手は間違いなく良いですから、インストールしておきます。

$ yum -y install iptablesreturn
..

Installed:
  iptables.x86_64 0:1.3.5-5.3.el5_4.1

Complete!

$ yum -y install vim-enhancedreturn
..

Installed:
  vim-enhanced.x86_64 2:7.0.109-7.el5

Dependency Installed:
  gpm.x86_64 0:1.20.1-74.1                vim-common.x86_64 2:7.0.109-7.el5

Complete!

$

これだけOKです。


日本語に対応にする。

デフォルトでCentOSのロケールの設定は日本に設定されています。
ただ、サポート情報が抜けているようなので、そこだけ追加しておきます。

/etc/sysconfig/i18nを編集します。
初期状態は以下のようになっています。

LANG="ja_JP.UTF-8"

これを、以下のように変更します。

LANG="ja_JP.UTF-8"
SUPPORTED="ja_JP.UTF-8:ja_JP:ja"
SYSFONT="latarcyrheb-sun16"

ユーザを追加する。

ここでは、SSHで唯一ログインを許可するようにしたhogeユーザを追加してみましょう。

$ useradd hogereturn
$ passwd hogereturn
Changing password for user hoge.
New UNIX password:
passwd: all authentication tokens updated successfully.
$ usermod -G wheel hogereturn
$

useraddで、hogeというユーザを追加しています。
passwdで、hogeのパスワードを設定しています。
usermodで、hogeをwheelのユーザグループに追加しています。
wheelは、管理者グループになります。

/usr/sbin/ へのパスが設定されていない場合は、useradd などのコマンドを指定する際、フルパスで指定します。

例)
$ /usr/sbin/useradd hogereturn

ログイン環境を編集する。

vimを標準のエディタとして使うために、vi のaliasとして登録しておきます。
また、/sbin へのパスも設定しておくと便利です。パスをとおしておくと、いちいち/sbinを先頭にタイプしなくて良くなりますからね。

.bash_profile は、各ユーザのホームディレクトリ直下にある( 例: ~hoge/.bash_profile ) ものを編集します。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# .bash_profile
 
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
 
# User specific environment and startup programs
 
PATH=$PATH:$HOME/bin:/sbin:/usr/sbin
 
# alias
alias vi='vim'
 
export PATH

10行目で、/sbin/usr/sbinへのパスと追加しています。
13行目で、vimの別名をviとしています。

現在ログインしている状態で、上記の編集情報を有効にするには、
$ source ~hoge/.bash_profilereturn
とすればOKです。

要らないコンソールを無効にする

不要なコンソールは、デフォルトで設定されているtty2からtty6 をすべてコメントアウトする。

/etc/inittab を編集します。

...
# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
# 以下の tty1 以外の設定を全てコメントアウトします。
#2:2345:respawn:/sbin/mingetty tty2
#3:2345:respawn:/sbin/mingetty tty3
#4:2345:respawn:/sbin/mingetty tty4
#5:2345:respawn:/sbin/mingetty tty5
#6:2345:respawn:/sbin/mingetty tty6
...

selinuxをoffにする

SELINUX=enforcingSELINUX=disabled とし、無効にする。

/etc/sysconfig/selinux を編集します。

...
#SELINUX=enforcing
#SELINUX=permissive
SELINUX=disabled
...

SSHのポートを変更する。

SSHのポートを変更して、簡単にアタックされないようにしておきます。指定するポート番号は、10000以降の適当なポート番号を割り当てましょう。

/etc/ssh/sshd_config を編集します。

...
# ポート番号を 22 (デフォルト)から10022へ変更する
#Port 22
Port 10022
...
# SSHのプロトコルをSSH2のみ対応とする
Protocol 2
...
# rootでのログインを不可とする
PermitRootLogin no
...
# パスワードでのログインを許可する
PasswordAuthentication yes
...
# パスワードなしでのログインを不可とする
PermitEmptyPasswords no
...
# hoge というユーザだけログインを許可する
AllowUsers hoge
...

ここでは、ポート番号、SSHプロトコル、rootでのログイン不可、ログイン可能なユーザ名を指定しています。
(後でhogeというユーザを追加しています。)
また、ログインするIPアドレスが決まっているなら、許可するIPアドレスも指定した方がより良いです。


設定を終えたら、sshd の設定ファイル再読み込みを実施します。

$ /etc/init.d/sshd reloadreturn
sshd を再読み込み中:                                       [  OK  ]
$

この状態で、上記の例で言うと、
ユーザ : hoge
ポート番号 : 10022
でログインできるか確認しましょう。

ログインできればOKです。
できない場合は、設定を再度見直しましょう。

sshd reload がポイントです。
とりあえず、再読み込みの場合は、現在SSHで接続しているクライアントには影響ありません。そのため、もしも設定に誤りがあった場合に、再編集することができます。
sshd を再起動してしまうと、現在接続しているクライアントは解放されてしまうので注意が必要です。
ここでは、詳しく解説していませんが、さらにセキュリティを強化するために公開鍵認証にてログインするようにしておいた方が良いでしょう。
(詳しくは、TeraTermで 公開鍵認証(鍵交換)を使ってSSH 接続してみる を参照してください。)

ファイアウォール(iptables)の設定を行う。

ここでは、単純にiptablesを使っていないポートを外部に非公開とするようにします。
シェルファイルを作成して、一気にやってしまいます。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
 
/sbin/iptables -F
/sbin/iptables -X
 
/sbin/iptables -P INPUT DROP
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD DROP
 
/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A OUTPUT -o lo -j ACCEPT
 
/sbin/iptables -A INPUT -s 10.0.0.0/8 -j DROP
/sbin/iptables -A INPUT -s 172.16.0.0/12 -j DROP
/sbin/iptables -A INPUT -s 192.168.0.0/16 -j DROP
 
/sbin/iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
 
/sbin/iptables -A INPUT -p tcp --dport 10022 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
 
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 
/etc/rc.d/init.d/iptables save
 
/sbin/service iptables restart

ここでは、10022(SSH),80(HTTP)の2つのポートのみを公開し、それ以外をすべて非公開にしています。
また、プライベートIPアドレス(10.x.x.x,172.16.x.x,192.168.x.x)は、すべて拒否してます。

pingを受け付けたくない場合は、17行目のicmpの許可を行っているところをコメントアウトしてください。
また、上記は、必要最小限のポートしか開いていません。pop3やmailなどの必要なポートは、19行目を真似て開くと良いでしょう。

ファイルにしたら、実行権限を与えるのを忘れないでね。
$ chmod 755 ファイル名return
$ ./ファイル名return
で実行できるはずです。

SSHのポートだけは、絶対に間違えないようにしましょう。この例では、10022を開放しています。
誤ってSSHのポートを閉じてしまうと、二度とアクセスできなくなります。 CloudCoreでは、現在(2012.01.30)、リモートコンソールが提供されていますので、最悪の場合は、リモートコンソールからのアクセスで修正することができます。

不要なサービス(デーモン)を停止する。

最後に、無駄に動作しているプロセスを停止するようにします。

デフォルトで動作している全プロセスは、以下のとおりです。

$ ps auxreturn
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1  10372   632 ?        Ss   Feb27   0:01 init [3]
root         2  0.0  0.0      0     0 ?        S<   Feb27   0:00 [migration/0]
root         3  0.0  0.0      0     0 ?        SN   Feb27   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S<   Feb27   0:00 [watchdog/0]
root         5  0.0  0.0      0     0 ?        S<   Feb27   0:00 [migration/1]
root         6  0.0  0.0      0     0 ?        SN   Feb27   0:00 [ksoftirqd/1]
root         7  0.0  0.0      0     0 ?        S<   Feb27   0:00 [watchdog/1]
root         8  0.0  0.0      0     0 ?        S<   Feb27   0:02 [events/0]
root         9  0.0  0.0      0     0 ?        S<   Feb27   0:00 [events/1]
root        10  0.0  0.0      0     0 ?        S<   Feb27   0:00 [khelper]
root        15  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kthread]
root        20  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kblockd/0]
root        21  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kblockd/1]
root        22  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kacpid]
root        91  0.0  0.0      0     0 ?        S<   Feb27   0:00 [cqueue/0]
root        92  0.0  0.0      0     0 ?        S<   Feb27   0:00 [cqueue/1]
root        95  0.0  0.0      0     0 ?        S<   Feb27   0:00 [khubd]
root        97  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kseriod]
root       169  0.0  0.0      0     0 ?        S    Feb27   0:00 [khungtaskd]
root       170  0.0  0.0      0     0 ?        S    Feb27   0:01 [pdflush]
root       171  0.0  0.0      0     0 ?        S    Feb27   0:00 [pdflush]
root       172  0.0  0.0      0     0 ?        S<   Feb27   0:03 [kswapd0]
root       173  0.0  0.0      0     0 ?        S<   Feb27   0:00 [aio/0]
root       174  0.0  0.0      0     0 ?        S<   Feb27   0:00 [aio/1]
root       311  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kpsmoused]
root       349  0.0  0.0      0     0 ?        S<   Feb27   0:00 [scsi_eh_0]
root       353  0.0  0.0      0     0 ?        S<   Feb27   0:00 [ata/0]
root       354  0.0  0.0      0     0 ?        S<   Feb27   0:00 [ata/1]
root       355  0.0  0.0      0     0 ?        S<   Feb27   0:00 [ata_aux]
root       365  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kstriped]
root       378  0.0  0.0      0     0 ?        S<   Feb27   0:12 [kjournald]
root       408  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kauditd]
root       974  0.0  0.0      0     0 ?        S<   Feb27   0:00 [vballoon]
root      1156  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kmpathd/0]
root      1157  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kmpathd/1]
root      1158  0.0  0.0      0     0 ?        S<   Feb27   0:00 [kmpath_handle]
root      1350  0.0  0.0      0     0 ?        S<   Feb27   0:00 [iscsi_eh]
root      1410  0.0  0.0      0     0 ?        S<   Feb27   0:00 [ib_addr]
root      1420  0.0  0.0      0     0 ?        S<   Feb27   0:00 [ib_mcast]
root      1421  0.0  0.0      0     0 ?        S<   Feb27   0:00 [ib_inform]
root      1422  0.0  0.0      0     0 ?        S<   Feb27   0:00 [local_sa]
root      1425  0.0  0.0      0     0 ?        S<   Feb27   0:00 [iw_cm_wq]
root      1429  0.0  0.0      0     0 ?        S<   Feb27   0:00 [ib_cm/0]
root      1430  0.0  0.0      0     0 ?        S<   Feb27   0:00 [ib_cm/1]
root      1435  0.0  0.0      0     0 ?        S<   Feb27   0:00 [rdma_cm]
root      1452  0.0  0.0  28628   224 ?        Ssl  Feb27   0:00 brcm_iscsiuio
root      1457  0.0  0.0  12148   404 ?        Ss   Feb27   0:00 iscsid
root      1458  0.0  0.8  12644  4456 ?        S<Ls Feb27   0:00 iscsid
root      1557  0.0  0.0  14580   420 ?        Ss   Feb27   0:00 mcstransd
root      1844  0.0  0.1  92908   756 ?        S<sl Feb27   0:03 auditd
root      1846  0.0  0.1  81832   832 ?        S<sl Feb27   0:02 /sbin/audispd
root      1867  0.0  2.2  27252 11624 ?        Ss   Feb27   0:00 /usr/sbin/resto
root      1880  0.0  0.1   5932   592 ?        Ss   Feb27   0:02 syslogd -m 0
root      1883  0.0  0.0   3828   392 ?        Ss   Feb27   0:00 klogd -x
root      1961  0.0  0.0  10784   308 ?        Ss   Feb27   0:09 irqbalance
rpc       1992  0.0  0.1   8076   544 ?        Ss   Feb27   0:00 portmap
root      2023  0.0  0.0      0     0 ?        S<   Feb27   0:00 [rpciod/0]
root      2024  0.0  0.0      0     0 ?        S<   Feb27   0:00 [rpciod/1]
dbus      2087  0.0  0.2  31780  1276 ?        Ssl  Feb27   0:00 dbus-daemon --s
root      2101  0.0  0.1  10456   532 ?        Ss   Feb27   0:00 /usr/sbin/hcid
root      2107  0.0  0.0   5960   384 ?        Ss   Feb27   0:00 /usr/sbin/sdpd
root      2130  0.0  0.0      0     0 ?        S<   Feb27   0:00 [krfcommd]
root      2176  0.0  0.1  21064   584 ?        Ssl  Feb27   0:00 pcscd
root      2190  0.0  0.0   3824   456 ?        Ss   Feb27   0:00 /usr/sbin/acpid
68        2204  0.0  0.2  30828  1384 ?        Ss   Feb27   0:02 hald
root      2205  0.0  0.1  21720   692 ?        S    Feb27   0:00 hald-runner
68        2212  0.0  0.1  12344   696 ?        S    Feb27   0:00 hald-addon-acpi
68        2220  0.0  0.1  12348   692 ?        S    Feb27   0:00 hald-addon-keyb
root      2230  0.0  0.1  10252   652 ?        S    Feb27  11:31 hald-addon-stor
root      2252  0.0  0.0   8540   364 ?        Ss   Feb27   0:00 /usr/bin/hidd -
root      2387  0.0  0.0   6480   384 ?        Ss   Feb27   0:00 gpm -m /dev/inp
root      2400  0.0  0.1  75708   588 ?        Ss   Feb27   0:00 crond
xfs       2440  0.0  0.1  20656   568 ?        Ss   Feb27   0:00 xfs -droppriv -
root      2465  0.0  0.0  18756   332 ?        Ss   Feb27   0:00 /usr/sbin/atd
root      2500  0.0  0.0  18440   264 ?        S    Feb27   0:00 /usr/sbin/smart
root      2503  0.0  0.0   3812   444 tty1     Ss+  Feb27   0:00 /sbin/mingetty
root      2504  0.0  0.0   3812   444 tty2     Ss+  Feb27   0:00 /sbin/mingetty
root      2506  0.0  0.0   3812   444 tty3     Ss+  Feb27   0:00 /sbin/mingetty
root      2507  0.0  0.0   3812   440 tty4     Ss+  Feb27   0:00 /sbin/mingetty
root      2509  0.0  0.0   3812   440 tty5     Ss+  Feb27   0:00 /sbin/mingetty
root      2520  0.0  0.0   3812   444 tty6     Ss+  Feb27   0:00 /sbin/mingetty
root      3470  0.0  0.3  13716  1940 ?        S<s  Feb27   0:00 /sbin/udevd -d
root      4581  0.0  0.2  56480  1520 ?        SNsl Feb27   0:00 automount
root      4698  0.0  0.2  62660  1216 ?        SNs  Feb27   0:02 /usr/sbin/sshd
root      4767  0.0  0.1  55208   772 ?        SNs  Feb27   0:00 rpc.idmapd
rpcuser   4820  0.0  0.1  14384   884 ?        SNs  Feb27   0:00 rpc.statd
root      4861  0.0  0.4  69040  2344 ?        SNs  Feb27   0:00 sendmail: accep
smmsp     4870  0.0  0.3  59792  1796 ?        SNs  Feb27   0:00 sendmail: Queue
root     32002  0.0  0.6  90160  3396 ?        SNs  14:13   0:00 sshd: root@pts/
root     32004  0.0  0.2  66084  1528 pts/0    SNs  14:13   0:00 -bash
root     32096  0.0  0.1  65612   988 pts/0    RN+  14:33   0:00 ps aux

$ chkconfig --listreturn
NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off
acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off
anacron         0:off   1:off   2:on    3:on    4:on    5:on    6:off
atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off
auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
autofs          0:off   1:off   2:off   3:on    4:on    5:on    6:off
bluetooth       0:off   1:off   2:on    3:on    4:on    5:on    6:off
capi            0:off   1:off   2:off   3:off   4:off   5:off   6:off
conman          0:off   1:off   2:off   3:off   4:off   5:off   6:off
cpuspeed        0:off   1:on    2:on    3:on    4:on    5:on    6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
dnsmasq         0:off   1:off   2:off   3:off   4:off   5:off   6:off
dund            0:off   1:off   2:off   3:off   4:off   5:off   6:off
firstboot       0:off   1:off   2:off   3:on    4:off   5:on    6:off
gpm             0:off   1:off   2:on    3:on    4:on    5:on    6:off
haldaemon       0:off   1:off   2:off   3:on    4:on    5:on    6:off
hidd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
irda            0:off   1:off   2:off   3:off   4:off   5:off   6:off
irqbalance      0:off   1:off   2:on    3:on    4:on    5:on    6:off
iscsi           0:off   1:off   2:off   3:on    4:on    5:on    6:off
iscsid          0:off   1:off   2:off   3:on    4:on    5:on    6:off
isdn            0:off   1:off   2:on    3:on    4:on    5:on    6:off
kudzu           0:off   1:off   2:off   3:on    4:on    5:on    6:off
lvm2-monitor    0:off   1:on    2:on    3:on    4:on    5:on    6:off
mcstrans        0:off   1:off   2:on    3:on    4:on    5:on    6:off
mdmonitor       0:off   1:off   2:on    3:on    4:on    5:on    6:off
mdmpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
messagebus      0:off   1:off   2:off   3:on    4:on    5:on    6:off
multipathd      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
netplugd        0:off   1:off   2:off   3:off   4:off   5:off   6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
nfs             0:off   1:off   2:off   3:off   4:off   5:off   6:off
nfslock         0:off   1:off   2:off   3:on    4:on    5:on    6:off
nscd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
oddjobd         0:off   1:off   2:off   3:off   4:off   5:off   6:off
pand            0:off   1:off   2:off   3:off   4:off   5:off   6:off
pcscd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
portmap         0:off   1:off   2:off   3:on    4:on    5:on    6:off
psacct          0:off   1:off   2:off   3:off   4:off   5:off   6:off
rawdevices      0:off   1:off   2:off   3:on    4:on    5:on    6:off
rdisc           0:off   1:off   2:off   3:off   4:off   5:off   6:off
readahead_early 0:off   1:off   2:on    3:on    4:on    5:on    6:off
readahead_later 0:off   1:off   2:off   3:off   4:off   5:on    6:off
restorecond     0:off   1:off   2:on    3:on    4:on    5:on    6:off
rpcgssd         0:off   1:off   2:off   3:on    4:on    5:on    6:off
rpcidmapd       0:off   1:off   2:off   3:on    4:on    5:on    6:off
rpcsvcgssd      0:off   1:off   2:off   3:off   4:off   5:off   6:off
saslauthd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
sendmail        0:off   1:off   2:on    3:on    4:on    5:on    6:off
smartd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
syslog          0:off   1:off   2:on    3:on    4:on    5:on    6:off
tcsd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
wpa_supplicant  0:off   1:off   2:off   3:off   4:off   5:off   6:off
xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off
ypbind          0:off   1:off   2:off   3:off   4:off   5:off   6:off
yum-cron        0:off   1:off   2:on    3:on    4:on    5:on    6:off

動作している各サービスは、以下のようなものです。
設定欄でOFF となっているものは、停止しても良いと思いますので、停止します。

サービス概要設定
acpid 電源管理 ON
anacron cronの知的版?のようなもの cronで十分な人には不要 OFF
atd at (コマンド)デーモン ON
auditd システム監査結果のログ保存 OFF
autofs ファイルシステムの自動マウント OFF
bluetooth 文字通りbluetooth OFF
cpuspeed システムのアイドル比率に応じてCPUの動作周波数を上下させる ON
crond cronデーモン ON
firstboot インストール直後に呼び出されるもの OFF
gpm コンソール上でマウス操作が可能になる。カット&ペーストもできるようになる。 OFF
haldaemon D-BUSサポート OFF
hidd bluetoothのキーボードやマウスの対応 OFF
ip6tables ipv6用iptables ON
iptables iptables (ファイアウォール) ON
irqbalance マルチCPU環境でセカンドCPU以降も割り込み処理を行える OFF
iscsi SCSIプロトコルをTCP/IPネットワーク上で使用する規格 ON
iscsid SCSIプロトコルをTCP/IPネットワーク上で使用するためのデーモン ON
isdn ISDN用デーモン OFF
kudzu ハードウェアの構成変更を検知 OFF
lvm2-monitor LVMの障害監視 OFF
mcstrans SELinuxの運用サポート OFF
mdmonitor mdデバイスの監視 OFF
messagebus D-BUSサポート OFF
netfs NFSクライアント OFF
network ネットワークサービス ON
nfslock NFSロック OFF
pcscd スマートカードの管理 OFF
portmap RPCのポートマッパー OFF
rawdevices ハードディスクをブロックデバイスとして利用する際の補助 OFF
readahead_early 前もってファイルをページ・キャッシュに読み込む OFF
readahead_later 前もってファイルをページ・キャッシュに読み込む OFF
restorecond SELinuxの運用サポート OFF
rpcgssd RPCサポート OFF
rpcidmapd RPCサポート OFF
sendmail sendmail(メールデーモン) ON
smartd S.M.A.R.Tのサポート OFF
sshd SSHデーモン ON
syslog シスログデーモン ON
xfs Xフォントサーバ OFF
yum-cron yumクーロン OFF

シェルファイルを作成して、一気にやってしまいます。

#!/bin/sh
 
/sbin/chkconfig anacron off
/sbin/chkconfig auditd off
/sbin/chkconfig autofs off
/sbin/chkconfig bluetooth off
/sbin/chkconfig firstboot off
/sbin/chkconfig gpm off
/sbin/chkconfig haldaemon off
/sbin/chkconfig hidd off
/sbin/chkconfig irqbalance off
/sbin/chkconfig isdn off
/sbin/chkconfig kudzu off
/sbin/chkconfig lvm2-monitor off
/sbin/chkconfig mcstrans off
/sbin/chkconfig mdmonitor off
/sbin/chkconfig messagebus off
/sbin/chkconfig netfs off
/sbin/chkconfig nfslock off
/sbin/chkconfig pcscd off
/sbin/chkconfig portmap off
/sbin/chkconfig rawdevices off
/sbin/chkconfig readahead_early off
/sbin/chkconfig readahead_later off
/sbin/chkconfig restorecond off
/sbin/chkconfig rpcgssd off
/sbin/chkconfig rpcidmapd off
/sbin/chkconfig smartd off
/sbin/chkconfig xfs off
/sbin/chkconfig yum-cron off
ファイルにしたら、実行権限を与えるのを忘れないでね。
$ chmod 755 ファイル名return
$ ./ファイル名return
で実行できるはずです。

最後にシステムのリブートを実行します。

$ rebootreturn
....
立ち上がったら、メモリを確認してみましょう。
$ freereturn
             total       used       free     shared    buffers     cached
Mem:        509760      73672     436088          0       8592      35628
-/+ buffers/cache:      29452     480308
Swap:      1052248          0    1052248
上記は、何も負荷が掛かっていない状態なので、100MBも使っていません。
どうでしたか、そこそこ減っているのではないでしょうか。

ざっとですが、こんな感じです。

ここに書いているのは、あくまで必要最小限としての記載ですので、ユーザによっては、もっと、セキュリティ面で強化を図ることもできると思います。

いろいろ設定してみて、Logwatch ぐらいは確認しておきましょう。
変なアクセスがないかぐらいは、チェックしておきましょう。

ABLENET VPSは、格安 (¥480 /月) のKVM VPSを提供しているレンタルサーバーです。 安いだけあってパワー不足は否めませんが、VPSを初めて扱う方や、バックグランド処理を行うようなサーバーなら使い勝手はあると思いますね。

ABLENET VPS を試してみたい方は、http://www.ablenet.jp/からどうぞ。無料お試し期間が10日間あります。



関連記事 :


コメントを投稿 :

お名前 *

メールアドレス *
( メールアドレスが公開されることはありません。)

サイトアドレス

コメント *

* 印の項目は、入力が必要な項目です。




最近投稿の記事

Genymotionとは、 公式サイト(http://www.genymotion.com/)には、以下のように記述があります。 G ...

以下のように Android x86 を仮想マシンへインストールし、色々と試してきました。 仮想マシンを使って Android ...

Android x86とは、 いわゆる Android のPC版OSです。 Android は、Googleによって開発されたスマー ...

Android x86とは、 いわゆる Android のPC版OSです。 Android は、Googleによって開発されたスマー ...

今回は、Mondo Rescue を使って バックアップとリストア(復元)をやってみたいと思います。 いまだに、さくらのVPSは、バッ ...


さくらのVPS 全プラン リニューアルです。(石狩(北海道)も選択可)


root権限ありで ¥685 / 月 ~ と非常にリーズナブルな CPU 1(core)の 512 プランから、 最高 CPU 10(core), メモリ 32(GB), SSD容量 800(GB) までとプランが充実。
ディスクは、SSDとHDDの選択が可能になった他、データセンターは人気の東京、石狩(北海道)となりました。

また、どのプランでも好きなOSが選べます
( CentOS, Fedora, Scientific Linux, FreeBSD, Ubutu, Debian )

管理人もおすすめのVPSです。
試用期間がありますから、一度、お試しを!!

詳しくは、http://vps.sakura.ad.jp/さくらのVPSのサイトへ へどうぞ!!

カテゴリ


Serverman@VPS 完全1ヶ月無料 キャンペーン実施中です。


Serverman@VPS 完全1ヶ月無料 キャンペーン実施中です。
最近、スワップにも対応した Serverman@VPS は、かなりリーズナブルかもです。

  • メモリ1GB~2GBのEntryプラン :月額:490円
  • メモリ2MB~4GBのStandardプラン :月額:980円
  • メモリ4GB~8GBのProプラン :月額:1,980円

新規申し込みで1ヶ月間完全無料となるキャンペーンを実施中です。
Serverman@VPSの特徴は、安さとIPv6対応です。また、初期設定費0円もポイントです。

IPv6でちょっと遊んでみたい方には、おすすめかもしれませんね。最低利用期間もありませんから、気に入らないときは即解約もできます。

Serverman@VPSの詳細については、 http://dream.jp/vps/ Serverman@VPSのサイトへへどうぞ。



KVM採用 ConoHa VPSは、時間単位で借りれる便利なVPSです。


ConoHa VPS は、初期設定費0円最低利用期間無し時間単位で清算可能、 さらに、Web APIを使って自動化を図ることもできる便利なVPSです。

海外サーバー設置も可能で、ローカル接続にも対応と、かなり、機能豊富なサーバーです。

新規ユーザ登録で、クーポンもらえますから、まずは、お試しですね。

ConoHa VPSの詳細については、
http://www.conoha.jp/ へどうぞ。

KVM採用 お名前.com VPS(KVM) 2G プラン 初期設定費無料 キャンペーン 実施です。


メモリ2GBプラン CPU:3core、Disk:200GB
月額:1,153円から (初期設定:1,680円0円)

さくらのVPSがリニューアルされてもなんのその。
1GBメモリ / 2Core を ¥834 – の格安価格で提供中です!
間違いなくスペックからすると割安感ありです。
年間割引時の途中解約で返金がないのは、 ちょっと残念ですが、それでもこの割安感は魅力です。

まずは、お試しですね。

お名前.com VPS(KVM)の詳細については、
http://www.onamae-server.com/vps/ へどうぞ。(お試し期間が15日あります。)



  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ
Time : 0.2333 [s]