2012-02-01から1ヶ月間の記事一覧

注意 sshでログインできる

良し悪しは分かれるところだが、sshdの設定で何とかする

パスワードを削除

passwd -d shutdownパスワード入力なしでログインできるように

/etc/sudoers

shutdown ALL=(ALL) NOPASSWD: ALLshutdownユーザーでshutdownをsudoできるように設定全コマンドを実行できるようにしている。あんまり良くないかも。

/etc/passwd

shutdown:x:6:0:shutdown:/sbin:/root/script/shutdown.shユーザーshutdownのログインシェルにshutdownシェルを指定する

shutdownシェル

#!/bin/bash sudo /sbin/shutdown -h now/root/script/shutdown.sh としておきましょうか。

shutdownユーザー

linuxだと無効になってるみたいですね。ログインしたらshutdownが走るshutdownユーザーを作ろうというお話。

リンクを絶対パスで

htmlヘルパーとか、formヘルパーなんかで生成されたURLって基本的に相対パスで書かれる。これを絶対パスで書いてもらおうとするお話。とりあえず、cake/lib/router.phpを見てみる * @param mixed $full If (bool) true, the full base URL will be prepended…