發表文章

目前顯示的是有「工作日誌」標籤的文章

FreeNAS 設定自動開關機以節省電力

⒈按DEL進入BIOS選單 ⒉進入Power功能表 ⒊點選 Power On By RTC Alarm [Disabled],預設是 [Disabled],要改為 [Enabled],再來就要改 RTC Alarm Date 和 System Time。 以下節自主機板的說明書。 Allows you to enable or disable RTC to generate a wake-up event. Configuration options: [Disabled] [Enabled] The following items appear only when the Resume On RTC Alarm item is set to [Enabled]. RTC Alarm Date [15] To set the alarm date, highlight this item and press the <+> or <-> key to make the selection. ⒋我的設定是下班時間開機,晚上就寢時間關機,這樣至少省掉一半的電力。 ⒌讓FreeNAS自動關機的設定部分參考 http://www.youtube.com/watch?v=qlOoj7s90rY

FreeBSD 系統安全

伺服器常被踹,除了防火牆外,從 TCP Wrappers 來防堵吧! 修改 /etc/hosts.allow sshd : ALL except 221.238.145.257 192.168.1.0/255.255.255.0 \ : spawn=(echo `date` - %u@%h[%a] attempted to access %s|/usr/bin/mail -s "%a[%h] access sshd" \ admin@tshes.tcc.edu.tw) & \ : deny sshd : ALL : allow 除了 221.238.145.257 以及 192.168.1.0/255.255.255.0 網域,其它地方的 connections 一律拒絕,並且發信通知網管人員。

FreeBSD 基本環境設定

我一直懶得去學 Linux 的原因就是 FreeBSD 的軟體安裝機制 ports。 首先,將 csup 的有關的三個設定範例檔 copy 到 root 家目錄。 %cp /usr/share/examples/cvsup/ports-supfile /root/ %cp /usr/share/examples/cvsup/stable-supfile /root/ %cp /usr/share/examples/cvsup/doc-supfile /root/ 將三個檔案中預設的 csup 站台,改成我慣用的 cvsup4.tw.FreeBSD.org(速度較快) 將 *host=CHANGE_THIS.FreeBSD.org 改為 *default host=cvsup4.tw.FreeBSD.org 開始下載安裝 ports、source 及說明文件。 %csup -g -L 2 /root/ports-supfile %csup -g -L 2 /root/stable-supfile %csup -g -L 2 /root/doc-supfile 如果不改範例檔,可直接指定 host 來安裝。 # csup -L 2 -h cvsup4.tw.FreeBSD.org /usr/share/examples/cvsup/ports-supfile 1. 遙控主機 /etc/rc.conf 要啟動 sshd,先在 /etc/rc.conf 中做設定: sshd_enable="YES" 直接將預設的文字抓出來修改比較快。 # grep 'sshd_eanble' /etc/defaults/rc.conf >> /etc/rc.conf 然後執行 # /etc/rc.d/sshd restart rc.conf 必須先有 sshd_enable="YES" 的設定,sshd 才能真的啟動。 如果只是想單純啟動sshd的話,可以不管  rc.conf 有無設定,直接啟動 sshd # /etc/rc.d/sshd onerestart 利用: # /etc/rc.d/sshd rcvar 這用來檢查 rc.conf 中關於 sshd 的設定,以及sshd有無啟動,大部分其它的 daemons的...