Fedora 8 - 初期設定
18 11 月 2007管理用ユーザー登録↓
# useradd server ← 管理用ユーザー server 登録 # passwd server ← 管理用ユーザー server のパスワードの設定 Changing password for user server. 新しいUNIX パスワード: 新しいUNIX パスワードを再入力してください: passwd: all authentication tokens updated successfully. # exit logout |
管理用ユーザーでログイン↓
[server@ns ~]$ ← 管理用ユーザーでログイン [server@ns ~]$ su - ← rootになってみる パスワード: ← root パスワード入力 [root@ns ~]# ← rootになれた ※「 su - 」 の最後の 「 - (ハイフン) 」 は指定したユーザーになった後、 そのユーザーのホームディレクトリに移動するため 例えば、 「 su - hogehoge 」 とした場合、は下記のようになる [root@ns ~]# pwd /root [root@ns ~]# [root@ns ~]# su - hogehoge [hogehoge@ns ~]$ [hogehoge@ns ~]$ pwd /home/hogehoge |
管理ユーザー用設定↓
# vi /etc/group wheel:x:10:root,server ← root になれるユーザーを指定 # vi /etc/pam.d/su auth required pam_wheel.so use_uid ← 5行目くらいの#を削除 # echo "SU_WHEEL_ONLY yes" >> /etc/login.defs # cat /etc/login.defs SU_WHEEL_ONLY yes |
「 yum 」 用設定↓
↓ yum の実行時にミラーサイトを自動検索してくれる # yum -y install yum-fastestmirror Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package yum-fastestmirror.noarch 0:1.1.8-1.fc8 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: yum-fastestmirror noarch 1.1.8-1.fc8 fedora 8.5 k Transaction Summary ============================================================================= Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 8.5 k Downloading Packages: (1/1): yum-fastestmirror- 100% |=========================| 8.5 kB 00:00 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2 Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora@redhat.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora Importing GPG key 0xDB42A60E "Red Hat, Inc <security@redhat.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: yum-fastestmirror ######################### [1/1] Installed: yum-fastestmirror.noarch 0:1.1.8-1.fc8 Complete! ↓ インストールしたパッケージをアップデートする # yum -y update Loading "fastestmirror" plugin Determining fastest mirrors Setting up Update Process Resolving Dependencies --> Running transaction check ・ ・ Transaction Summary ============================================================================= Install 4 Package(s) Update 40 Package(s) Remove 0 Package(s) Total download size: 63 M ・ ・ Complete! # vi /etc/cron.daily/yum.cron ← 自動でアップデートをするように #!/bin/sh /usr/bin/yum -y update yum > /dev/null 2>&1 ; /usr/bin/yum -y update > /dev/null 2>&1 # chmod +x /etc/cron.daily/yum.cron # vi /etc/cron.weekly/yum.cron ← yum でダウンロードしたファイル等を削除するように #!/bin/sh /usr/bin/yum -e 0 -d 0 clean packages # chmod +x /etc/cron.weekly/yum.cron ↓ これを起動しているとメモリ消費量がはげしい # /etc/rc.d/init.d/yum-updatesd stop yum-updates を停止中: [ OK ] # chkconfig yum-updatesd off ← 自動起動を停止 |
管理用メールの受取人を設定↓
# vi /etc/aliases #root: marc ↓ 先頭の#を削除して管理者用ユーザーに変更 root: server # newaliases ← 設定反映 /etc/aliases: 77 aliases, longest 10 bytes, 775 bytes total |
「 SELINUX 」 「 ファイヤウォール 」 用設定↓
↓ SELINUXの状態確認 # getenforce Enforcing ↓ SELINUXの停止 # setenforce 0 ↓ SELINUXの状態確認 # getenforce Permissive ↓ SELINUXの自動起動させないように設定 # vi /etc/sysconfig/selinux # 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. # disabled - No SELinux policy is loaded. SELINUX=enforcing ↓ 下記のように変更 SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted # SETLOCALDEFS= Check local definition changes SETLOCALDEFS=0 ※ルーター経由で接続している場合 ↓ IPv6用のIPTABLE停止 # /etc/rc.d/init.d/ip6tables stop ファイアウォールルールを適用中: [ OK ] チェインポリシーを ACCEPT に設定中filter [ OK ] ip6tables モジュールを取り外し中 [ OK ] ↓ IPv4用のIPTABLE停止 # /etc/rc.d/init.d/iptables stop ファイアウォールルールを適用中: [ OK ] チェインポリシーを ACCEPT に設定中filter [ OK ] iptables モジュールを取り外し中 [ OK ] # chkconfig ip6tables off ← IPv6用のIPTABLE自動起動停止 # chkconfig iptables off ← IPv6用のIPTABLE自動起動停止 |
「 yum 」 のリポジトリを追加↓
# wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt --00:48:52-- http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt dag.wieers.com をDNSに問いあわせています... 62.213.193.164 dag.wieers.com|62.213.193.164|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 200 OK 長さ: 1672 (1.6K) [text/plain] Saving to: `RPM-GPG-KEY.dag.txt' 100%[============================================>] 1,672 --.-K/s in 0s 00:48:54 (31.7 MB/s) - `RPM-GPG-KEY.dag.txt' を保存しました [1672/1672] # rpm --import RPM-GPG-KEY.dag.txt # rm -f RPM-GPG-KEY.dag.txt # vi /etc/yum.repos.d/dag.repo [dag] name=Dag RPM Repository for Fedora 8 baseurl=http://apt.sw.be/dries/fedora/fc8/i386/RPMS.dries/ gpgcheck=1 enabled=0 ※まだ何もないみたいですけど一応。 |
ネットワーク設定↓
# vi /etc/sysconfig/network ← ネットワーク用ファイル修正
NETWORKING_IPV6=no ← IPv6用通信停止
NOZEROCONF=yes ← 関係のないルーティングを停止
# vi /etc/modprobe.conf
alias net-pf-10 off ← IPv6用通信停止 先頭に記述
# route ← ルート情報確認
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.254.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
default buffalo.setup 0.0.0.0 UG 0 0 0 eth0
# ifconfig ← IPアドレス情報確認
eth0 Link encap:Ethernet HWaddr 00:0C:29:5B:D4:F3
inet addr:192.168.254.200 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe5b:d4f3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:48761 errors:0 dropped:0 overruns:0 frame:0
TX packets:28625 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:69829063 (66.5 MiB) TX bytes:2190833 (2.0 MiB)
Interrupt:17 Base address:0x1080
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)
# reboot ← システムリブート
# route ← ルート情報確認
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.254.0 * 255.255.255.0 U 0 0 0 eth0
default buffalo.setup 0.0.0.0 UG 0 0 0 eth0
↑ link-local がなくなっている
# ifconfig ← IPアドレス情報確認
eth0 Link encap:Ethernet HWaddr 00:0C:29:5B:D4:F3
inet addr:192.168.254.200 Bcast:192.168.254.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:49206 errors:0 dropped:0 overruns:0 frame:0
TX packets:29105 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:69865632 (66.6 MiB) TX bytes:2290992 (2.1 MiB)
Interrupt:17 Base address:0x1080
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)
↑ IPv6 情報がなくなっている
|
No comments yet
