PC/NETのetcetra/2007-10-28 の変更点

※※このサイトは2012年頃より更新を停止しています。※※

**postfix で queue を扱う手段
[[参考:postqueue - Postfix キュー制御>http://www.postfix-jp.info/trans-2.2/jhtml/postqueue.1.html]]
[[参考:postsuper - Postfix 監督プログラム>http://www.postfix-jp.info/trans-2.2/jhtml/postsuper.1.html]]
[[参考:qmgr - Postfix キューマネージャ>http://www.postfix-jp.info/trans-2.2/jhtml/qmgr.8.html]]
[[参考:postcat - Postfix キューファイルの中身の閲覧>http://www.postfix-jp.info/trans-2.2/jhtml/postcat.1.html]]
[[参考:Kozupon.com:Postfixの導入!>http://www.kozupon.com/mail/postfix.html]]
[[参考:Secure MTA(Postfix-TLS) 〜 smtp-auth & SMTP over SSL>http://www.jp-z.jp/linux/postfix_tls.html]]

**cron関連パッケージの種類
[[参考:Gentoo Linux Cronガイド>http://www.gentoo.org/doc/ja/cron-guide.xml?style=printable]]
[[参考:ITmedia エンタープライズ : Linux Tips「anacronデーモンって何?」>http://www.itmedia.co.jp/help/tips/linux/l0560.html]]
vixie-cron
fcron

**rootの作業ログを取る手段
[[参考:@IT:コマンドの実行履歴を残す>http://www.atmarkit.co.jp/fsecurity/rensai/unix_sec06/unix_sec02.html]]
[[参考:サバカン日記:psacct>http://www.isokiti.tv/~isobetti/index.php?eid=120]]
[[参考:Drk7jp:Linux/UNIX 上でコマンドの実行履歴を残す方法>http://www.drk7.jp/MT/archives/000988.html]]
[[参考:ずんWiki - acctでコマンド実行のログを取る>http://www.kawaz.jp/pukiwiki/?acct%A4%C7%A5%B3%A5%DE%A5%F3%A5%C9%BC%C2%B9%D4%A4%CE%A5%ED%A5%B0%A4%F2%BC%E8%A4%EB]]
[[参考:ITmedia エンタープライズ : Linux Tips「アカウントの利用統計が知りたい」>http://www.itmedia.co.jp/help/tips/linux/l0677.html]]
acctやscriptという手があるらしい。
 man accton
 man script
Redhat系だと下記でacctの機能を利用できるもよう。
 # yum install psacct
 # chkconfig psacct on
 # service psacct start
とか。
でも、rootでやってるのに /var/log/messages に
でも、VPSサービスのCentOS4でrootでやってるのに /var/log/messages に
 accton: accton: Operation not permitted
とか出る場合は、これもしかしてkernelの process accounting が有効になってなかったりする?
とか出るのは、これもしかしてkernelの process accounting が有効になってなかったりする?
[[参考:Linuxカーネルの設定パラメータ>General setup・・・一般的な設定>http://itpro.nikkeibp.co.jp/article/COLUMN/20071025/285507/?ST=lin-os]]
[[参考:ログの管理とセキュリティ> 2.  システムセキュリティにおけるログ> 2.2 プロセスアカウンティングログ(そこの「注意」)>http://www.ep.sci.hokudai.ac.jp/~epnetfan/zagaku/2001/0201/index.html#Chap2]]
[[参考:Kernel Config / 主な設定1>http://www.a-yu.com/system/kcfg01.html]]

現在のkernelパラメータの確認方法は、「ソースからkernelのconfigファイルを見る」以外に良い方法はあるか?
[[参考:kernelイメージから設定情報を取り出す>http://www.irori.org/doc/ikconfig.html]]
[[参考:CentOS/Linuxカーネルの再構築 〜CentOS4 全編〜>http://www.geocities.jp/tatsus490824/kernel_rebuild.html]]

**ssh と リモートログインの自動処理
sshd が起動時に /var/log/secure に「error: Bind to port」のログを吐いてる場合。
sshd_config で ListenAddress 0.0.0.0 のコメントアウトを解除してやろう。
[[参考:linux/openssh [OpenSSH;] - データシート (のくす牧場)>http://sea-mew.jp/nox/modules/xpwiki/?linux%2Fopenssh]]
[[参考:secureのsshdのログ>http://oshiete1.goo.ne.jp/qa3048466.html]]

sshd_config についての詳細は下記とかman sshd_config を参照のほど。
[[参考:FreeBSD 日本語マニュアル検索 (jman/japropos/jwhatis)>http://www.jp.freebsd.org/cgi/mroff.cgi?sect=5&cmd=&lc=1&subdir=man&dir=jpman-5.2.0%2Fman&subdir=man&man=sshd_config]]

sshdはデフォルトで公開鍵認証方式を受け付ける設定になってるらしい。(要確認)
下記を参考に、公開鍵認証方式の挙動を把握。
[[参考:SSHの公開鍵(publickey)設定>http://www.j.dendai.ac.jp/~fujimoto/system/publickey.html]]
[[参考:@IT:鍵交換方式のsshでアクセスするには>http://www.atmarkit.co.jp/flinux/rensai/linuxtips/429usekeyssh.html]]
[[参考:ssh -i identity_file(manの邦訳っぽい)>http://www.pse.che.tohoku.ac.jp/~hoshi/ssh.txt]]

パスフレーズの入力の省略方法について。(ssh-agent関連)
[[参考:SSH (Secure Shell) の使い方>http://www.is.titech.ac.jp/~taniguti/lab/ssh.html]]
[[参考:ssh-agentの注意>http://wiki.mmj.jp/index.php?Service%2Fssh#g23c6fe3]]
ssh-agent は一種のデーモン。
そいつに鍵情報を格納するコマンドが ssh-add
でもこいつはserviceコマンドで起動する対象じゃないから、システムリブート時などに困る。
これを使うなら自動で起動するようにそれ用のスクリプトを用意して /etc/init.d/local だったかそこら辺に仕込むような作業をしないといけない。
めんどいな(ノд`)

ssh-agent と cron との連系もシンプルではないみたい。
[[参考:ssh-agentでパスフレーズをキャッシュさせたい〜ノンパスワードの実現〜>http://www.itmedia.co.jp/help/tips/linux/l0403.html]]

最終的に、下記の文書が的を得た結論に至っていると思われる。
[[参考:Landscape - エンジニアのメモ 2004-11-17:ssh scp sftp の正しい自動実行方法>http://sonic64.com/2004-11-17.html]]
[[参考:正しいssh/scpの自動運転は ぴろ日記>http://www.banana-fish.com/~piro/20040609.html#p06]]
そしてその実践が下記。
[[参考:rsync + cron + ssh (rsyncd を立てない編)>http://www2s.biglobe.ne.jp/~nuts/labo/inti/cron-rsync-ssh-nodaemon.html]]

ミソは下記。
-sshd_config に書く「PermitRootLogin forced-commands-only」
-opensslで作る秘密鍵のパスフレーズを不要化すること。
-公開鍵(サーバ側に置くauthorized_keys)に書く「command="〜〜"」

#pcomment(reply)
トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS