星期五, 五月 02, 2008

FreeBSD SA Q&A

這篇是當我還是高中生,參加某神秘組織時,為了技術傳承而做紀錄。只是到後來還是差不多淪為個人筆記了,而某組織也已經...xd

由於年代久遠(FreeBSD4.5~FreeBSD5.3),有些東西應該out of date了,有誤請指正。

話說FreeBSD7, FreeBSD8都release,而我已經好久沒用BSD了(有些事情直接用ubuntu之類的比較不會找自己麻煩xd )。最近計中找工讀,難得列出要會BSD的人,跑過去發現是寫PHP+mysql的東西,小失望了一下:q  不過有機會應該也碰的到吧。

/*end of  intro*/


如何讓一個用戶只能ftp而無法telnet


1. 修改 /etc/passwd ,將該 user 的 shell 改為 /usr/bin/false

2. 在 /etc/shells 檔中增加 /usr/bin/false

此時,該用戶只能 ftp,而不能使用 telnet。




crontab設了不會跑?!

maybe最後一行完沒有按enter = =a <-榮登本系列最笨



#watch
Fatal: Cannot open snoop device.


BSD4.X
cd /dev ; sh MAKEDEV snp0 snp1 snp2 snp3 snp4 ....
REF: kernel:pseudo-device snp 16

BSD5.X
kernel :device snp




bind: Address already in use

檢查/etc/inetd /usr/local/etc/rc.d/ 有沒有重複啟動的服務
通常在/var/log/messenge的錯誤訊息可以看的出來是哪個service重複啟動



perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:


FreeBsd 5.2 R locale problem
已經改了,改成 en_US.ISO8859-1,那個底線已經拿掉了。
遇到 locale 有問題先看看 /usr/share/locale 吧!



抓下來目錄名有空白

ptc_3w: 抓下來目錄有空白
ptc_3w: 根本進不去
eric1300460: 可以
ptc_3w: 怎麼弄
eric1300460: 例如 b 1
ptc_3w: ?
eric1300460: 請打b\ 1



cfgmaker 錯誤

應該是沒啟動 snmpd
現在新版的程式大都改用 rc.subr 所以都要在
rc.conf 加入 xxxx_enable="YES"

而 snmpd 在 5.x 不知道多少之後就也是使用 rc.subr 所以要在 rc.conf 加
snmpd_enable="YES"
才會啟動
否則執行 /usr/local/etc/rc.d/snmpd.sh start 是沒反應的

PS: 目前網路上搜到的文件都該翻新了! 都是舊的照著做一定會漏掉這個



fetch: wxGTK-2.4.2.tar.bz2: local modification time does not match remote

校時試看看
man ntpdate



telnetd: All network ports in use. //只能開32個telnet

1.kernel 設定
pseudo-device pty " " <-預設? 2. /dev 底下缺乏相對應的檔案 #cd /dev //預設32個 #./MAKEDEV pty1 //+32=64 #./MAKEDEV pty1 pty2 //+32+32=96 ..已次類推... ref:http://freebsd.ntu.edu.tw/4/6.html http://cnpa.cse.yzu.edu.tw/~freebsd/kernel/5_6_2.htm PS.5.X的改變目前聽到的就是pty變成動態增加,不用努力去破kernel當中的pty上限




Q3.10 -- How do I solve "collect: I/O error on connection" errors?

Date: April 8, 1997

1.There is nothing wrong.
This is just a diagnosis of a condition that had not been diagnosed before.
If you are getting a lot of these from a single host, there is probably some
incompatibility between 8.x and that host.
If you get a lot of them in general, you may have network problems that are
causing connections to get reset.

Note that this problem is sometimes caused by incompatible values of the
MTU (Maximum Transmission Unit) size on a SLIP or PPP connection.
Be sure that your MTU size is configured to be the same value as what yo

2.sendmail.cf ->MaxMessageSize



根目錄為什麼不用soft-updates?

# man tuning
--snip--
First,
softupdates guarantees file system consistency in the case of a crash but
could very easily be several seconds (even a minute!) behind on pending
write to the physical disk. If you crash you may lose more work than
otherwise. Secondly, softupdates delays the freeing of file system
blocks. If you have a file system (such as the root file system) which
is close to full, doing a major update of it, e.g. ``make installworld'',
can run it out of space and cause the update to fail. For this reason,
softupdates will not be enabled on the root file system during a typical
install. There is no loss of performance since the root file system is
rarely written to.

By Dan Nelson (dnelson@emsphone.com)

The 2 drawbacks with SU are

1 - You can't immediately reuse the space occupied by a file you just
deleted; this may bite you if you do an installworld and don't have
20MB free on /. when it comes to installing /sbin, you need 18MB
for the new binaries, but you can't reuse the 18MB for the
just-deleted binaries.

2 - If you create a file, SU doesn't commit it immediately; it waits a
bit. If you edit rc.conf and crash (or reboot by power-cycling),
you may find you don't have an rc.conf.

0 意見: