Fedora 14

ネットワークの設定

  • /etc/sysconfig/network
    NETWORKING=yes
    HOSTNAME=srv1.TakeAsh.net
    DOMAINNAME=TakeAsh.net
    GATEWAY=192.168.0.1

yumの設定

自動的に近いミラーを参照するようにする

# yum -y install yum-plugin-fastestmirror

パッケージのアップデートと自動更新の設定

# yum install yum-cron
# service yum-cron start
# chkconfig --list yum-cron
# chkconfig yum-cron on
# chkconfig --list yum-cron

sshの設定

ホスト側の設定

  • 公開鍵/秘密鍵の作成(リモートからログインしたいアカウントで作業する)
    • ファイル名はそのままEnterを押す。
    • passphrase はログイン時に必要となるのでメモしておく。
    • 秘密鍵はUSBメモリ等漏洩しない経路でリモート側のマシンにコピーし、コピー後はホストから削除しておく。
$ ssh-keygen -t rsa
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys
  • /etc/ssh/sshd_config (rootで作業する)

    PermitRootLogin no
    PermitEmptyPasswords no
    PasswordAuthentication no
  • TeraTerm の鍵作成機能使って作った秘密鍵だと PuTTY 用に変換してもログインできなかったのは何故だろう。
    サーバで作成した秘密鍵の方は正常にログインできたけど。

クライアント側

  • クライアントとして Tera Term を使う。
  • *.ttl に ttpmacro.exe を関連付けておくことで自動ログインできる。
  • このマクロを使うときは C:\Program Files\TeraTerm\ssh_keys に秘密鍵ファイルをコピーしておくこと。
  • ログイン時には公開鍵/秘密鍵を作成したときのパスフレーズを毎回タイプする。
  • root のパスワードは初回のみタイプが必要。暗号化されてファイルに記録されるので2回目以降はタイプする必要はない。
  • srv1.ttl
    ; sample macro of Tera Term
    ;
    ; File: ssh2login.ttl
    ; Description: auto login with SSH2 protocol
    ; Environment: generic
    ; Update: 2004/12/4
    ; Author: Yutaka Hirata
    
    username = 'yourname'			; ログインに使うユーザアカウント名
    hostname = 'srv1.TakeAsh.net'
    keyfile  = '"C:\Program Files\TeraTerm\ssh_keys\id_rsa"'		; パスに空白を含む場合は""で括る。
    ;pwfile  = '"C:\Program Files\TeraTerm\ssh_keys\password.dat"'	; getpassword のファイル名に空白を含むことはできない?
    PasswordPrompt = 'パスワード:'
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    msg = 'Enter passphrase for user '
    strconcat msg username
    passwordbox msg 'Get passphrase'
    
    msg = hostname
    strconcat msg ':22 /ssh /auth=publickey /user='
    strconcat msg username
    strconcat msg ' /passwd='
    strconcat msg inputstr
    strconcat msg ' /keyfile='
    strconcat msg keyfile
    connect msg
    
    wait username		;自動的にrootになりたければここから下も記述
    sendln 'su -'
    wait PasswordPrompt
    getpassword 'C:\Program Files\TeraTerm\ssh_keys\password.dat' 'srv1_root' PasswordROOT
    sendln PasswordROOT

リンク

vncの設定

vnc serverのインストール

# yum install vnc-ltsp-config tigervnc-server

gdmの設定

  • /etc/gdm/custom.conf (抜粋)
    [xdmcp]
    Enable=true
    
    [greeter]
    IncludeAll=false

xinetd

  • /etc/xinetd.d/vncts (抜粋)

    service vnc-1024x768x16
    {
    	disable		= no
    	type		= UNLISTED
    	port		= 5900
    	socket_type	= stream
    	wait		= no
    	user		= nobody
    	group		= tty
    	server		= /usr/bin/vncts
    	server_args	= -geometry 1024x768 -depth 16
    	only_from	= 192.168.0.0/24 10.8.0.0/24
    }
  • xinetd の再起動

    # service xinetd restart

ファイアウォール設定

  1. 「システム/管理/ファイアーウォール」を起動。
  2. 「その他のポート」を選択。
  3. 「追加」をクリック。
  4. 「5900/TCP/vnc-server」を選択。
  5. 「OK」をクリック。
  6. 「適用」をクリック。

リンク

Postfixの設定

  • 自ドメイン内にホストマシンとは別に主メールサーバがある場合
    • myorigin は $mydomain ではなく $myhostname にする。
    • mydestination には $mydomain を含めない。
  • 転送設定を反映させるために postalias を実行した後、サービスを再起動する。
    # postalias hash:/etc/aliases
    # service postfix restart

リンク

Dovecotの設定

  • TLSを使わず平文パスワードで認証する場合
    • /etc/dovecot/conf.d/10-auth.conf
      disable_plaintext_auth = no

Sambaの設定

インストール

# yum install samba

共有用フォルダ

# cd /home
# mkdir Shared
# chown nobody:nobody Shared
# chmod 777 Shared

設定

  • /etc/samba/smb.conf (抜粋)
    [global]
    	workgroup = WORKGROUP
    
    	hosts allow = 127. 192.168.0. 10.8.0.
    	wide links = yes
    	follow symlinks = yes
    	unix extensions = no
    
    	security = user
    
    [homes]
    	browseable = no
    	writable = yes
    	valid users = %U
    
    [Shared]
    	path = /home/Shared
    	read only = no
    	browseable = yes
    	valid users = {アクセスを許可するユーザのリスト}
    	share modes = yes
    	dos filetimes = yes

サービス設定

# chkconfig --list smb
# chkconfig smb on
# chkconfig --list smb
# service smb restart
# chkconfig --list nmb
# chkconfig nmb on
# chkconfig --list nmb
# service nmb restart

ファイアウォール設定

  1. 「システム/管理/ファイアーウォール」を起動。
  2. 「信頼したサービス」を選択。
  3. 「Samba」にチェックを入れる。
  4. 「OK」をクリック。
  5. 「適用」をクリック。

SELinux設定

  1. 「システム/管理/SELinux Management」を起動。
  2. rootパスワード入力。
  3. 「選択: ブーリアン値」を選択。
  4. 「Module: samba」の「Allow samba to share any file/directory read/write.」にチェックを入れる。
  5. SELinuxの変更を反映させるため、Fedoraを再起動。

リンク

BIND設定

  • 外部ドメインの名前解決できない場合の対策(検索結果のキャッシュに失敗している)
    • SELinuxの「Allow BIND to write the master zone files. Generally this is used for dynamic DNS.(named_write_master_zones)」にチェックを入れる。
  • 「named: the working directory is not writable」対応
    # chmod 770 /var/named/chroot/var/named

リンク

logwatch設定

  • インストールされているかどうか確認
    # rpm -qa | grep logwatch
  • インストール
    # yum install logwatch

mcelog エラーメッセージ対応

  • 次のレポートメールが間違って飛ぶのを抑制する。
    /etc/cron.hourly/mcelog.cron:
    read: No such device
  • mcelog をアンインストールする。
# yum erase mcelog