- 追加された行はこの色です。
- 削除された行はこの色です。
*OSの基本セットアップ [#xebec10d]
#contents
*ネットワーク [#l5d67938]
-IPアドレス,NetMaskなどの設定
[root@centos4 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
-レゾルバ設定ファイル~
nslookupで引けないときにまず参照。
[root@centos4 ~]# cat /etc/resolv.conf
-ネットワーク再起動
/etc/init.d/network restart
*SSHのアクセス制限 [#y6d57243]
SSH接続の制限は、hosts.denyとhosts.allowを使用して行う。~
全てをdenyしておき、許可するものだけhosts.allowで設定する。
-hosts.deny(アクセス不可条件を設定するファイル )
#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!
ALL : ALL
-hosts.allow(アクセス許可条件を設定するファイル)~
preview環境からのみssh接続を許可するようにする。
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
ALL : 192.168.100.0/255.255.255.0
## SSH
sshd : 222.230.141.164
-sshでのrootログインを許可しない
[root@centos4 ssh]# vi /etc/ssh/sshd_config
(変更前)#PermitRootLogin yes
↓
(変更後)PermitRootLogin no
[root@centos4 ssh]# /etc/init.d/sshd restart
sshd を停止中: [ OK ]
sshd を起動中: [ OK ]
*ホスト名の設定 [#t94f73d3]
hostnameコマンドで書き換えるとリブートした場合、もとの設定に戻ってしまう。~
設定ファイルを書き換えることによってリブート後も設定は戻らない。
[root@centos4 apache]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=pre-tr.tribeck.com
リブート後、hostnameコマンドで代ったことを確認する。
[root@centos4 apache]# hostname
pre-tr.tribeck.com