關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • 限制用戶使用 crontab

    Posted on September 26th, 2006 Sam Tang No comments

    基於安全問題,在 Linux 下可以限制用戶使用 crontab 排程,而要設定的檔案分別有 /etc/cron.allow 及 /etc/cron.deny,它們的定義分別是:

    /etc/cron.allow
    如果 /etc/cron.allow 存在,只有這個檔案內的使用者才可使用 crontab。

    /etc/cron.deny
    在 /etc/cron.deny 內的使用者不可使用 crontab,未記錄的使用者才可以使用 crontab。

    在使用時只會選擇以上其一個設定檔來限制,其中以 /etc/cron.allow 比 /etc/cron.deny 優先。而寫入的格式必須是每一個使用者一行。

    另一點要注意的是,不管 root 是否在以上檔案內,都可以使用 crontab。


    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word