顯示文章

這裡允許您檢視這個會員的所有文章。請注意, 您只能看見您有權限閱讀的文章。


文章 - 被騎上班的老

頁: [1] 2 3 ... 12
1
KaLUG 討論版 / Debian - 如何關掉 IPV6
« 於: 2012-04-25 10:53 »
原文 http://wiki.debian.org/DebianIPv6
引用
1.Disable ipv6 in kernel : echo net.ipv6.conf.all.disable_ipv6=1 > /etc/sysctl.d/disableipv6.conf will disable ipv6 at next reboot.
引用
2.You will probably need to comment-out any IPv6 address in /etc/hosts (especially the one for loopback) otherwise ssh will fail to forward ports (or you must always use -4 to ssh).


1. 在 /etc/sysctl.d/ 新增一個檔案 disableipv6.conf ,裡面打一行 net.ipv6.conf.all.disable_ipv6=1 下次開機就會把 IPV6 關掉。
2. 把 /etc/hosts 裡面關於 IPV6 的部份 備註起來

如下,基本上見到 ip6 前面都打 # 就好了!

代碼: [選擇]
]# The following lines are desirable for IPv6 capable hosts
#::1     localhost ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#ff02::3 ip6-allhosts

然後重開機就好了!

2
LDAP 討論區 / 關於找不到 slapd.conf 的問題
« 於: 2012-04-07 20:51 »
最近更新了 LDAP 也發現這個問題,看了一下文件,翻譯如下:

OpenLDAP 2.3 以後採用動態設定引擎,man slapd-config。

特點是:使用標準 LDAP 操作更新設定檔,設定檔以 LDIF 資料庫的形式儲存於 slapd.d 的目錄下。設定完成之後,不需重新啟動伺服器,設定完成之後立即生效。 slapd.conf 目前仍支援,但未來會取消。 man slapd 去瞭解如何使用 slapd.conf 轉化成新的設定。

文件特別強調,不要試圖修改 LDIF 檔案,要使用 ldapadd, ldapdelete, ldapmodify 去修改設定檔。

3
Linux 討論版 / Re: 內部dns上網的問題
« 於: 2012-03-09 03:44 »
/etc/resolv.conf

你檔名有沒有對?

我也是這樣用,剛好 我的 nameserver 也是 192.168.100.1 ,沒什麼問題ㄚ!

4
Network 討論版 / Re: [問題]OpenVPN + IP Mapping
« 於: 2012-03-09 03:34 »
太難,看不懂! 不過有幾點看法,大家研究一下。

1.我覺得最大的問題是你兩邊的網段重複,這樣的話你如何寫 routing ? 也就是說,你要寫一個 Routing rule,去辨別這個封包是要送遠端還是近端。

2. 你連 VPN server 以外的機器,那台機器的 routing 要加一條 10.0.0.0 的 route 回 VPN server。因為除了 VPN server 知道 10.0.0.0 的封包怎麼送,VPN server 以外的機器是不會知道要怎麼送,或者你的 VPN server 設為 default gateway。

5
KaLUG 討論版 / Re: Debian - 防火牆 script
« 於: 2012-03-01 10:44 »
其實我也不是太瞭解,但是 TCP 53 跟 UDP 53 我都有開。
我設定的防火牆的方法是用 nmap 跟 nmap -sU 掃出自己有開的 port ,然後把這些加到 AIF 的 open 設定檔裡面。

令我起疑的是這一整個 C class網段,還有相鄰幾個 C class網段都有這個紀錄。我想我的網站應該沒有這麼紅,所以我才有這樣的疑惑。

6
其實你要學 Debian,你應該上 Debian 的網站啊!Debian 網站也有中文的網頁。

http://www.debian.org/doc/manuals/apt-howto/ch-basico.zh-tw.html

7
KaLUG 討論版 / Re: Debian - 防火牆 script
« 於: 2012-03-01 09:41 »
昨天設好之後,今天早上就一大堆老鼠。我不是 Firewall 的專家,請專家看看這是不是攻擊?

   From 61.220.4.17 - 2 packets to udp(53)
   From 61.220.4.18 - 1 packet to udp(53)
   From 61.220.4.19 - 1 packet to udp(53)
   From 61.220.4.20 - 3 packets to udp(53)
   From 61.220.4.22 - 1 packet to udp(53)
   From 61.220.4.23 - 1 packet to udp(53)
   From 61.220.4.24 - 2 packets to udp(53)
   From 61.220.4.25 - 1 packet to udp(53)
   From 61.220.4.29 - 7 packets to udp(53)
   From 61.220.4.30 - 1 packet to udp(53)
   From 61.220.4.31 - 1 packet to udp(53)
   From 61.220.4.32 - 5 packets to udp(53)
   From 61.220.4.34 - 3 packets to udp(53)
   From 61.220.4.35 - 2 packets to udp(53)
   From 61.220.4.37 - 2 packets to udp(53)
   From 61.220.4.38 - 1 packet to udp(53)
   From 61.220.4.39 - 3 packets to udp(53)
   From 61.220.4.40 - 9 packets to udp(53)
   From 61.220.4.41 - 2 packets to udp(53)
   From 61.220.4.42 - 2 packets to udp(53)
   From 61.220.4.43 - 7 packets to udp(53)
   From 61.220.4.45 - 7 packets to udp(53)
   From 61.220.4.47 - 2 packets to udp(53)
   From 61.220.4.48 - 2 packets to udp(53)
   From 61.220.4.49 - 2 packets to udp(53)

8
KaLUG 討論版 / Re: Debian - AIF + OpenVPN
« 於: 2012-03-01 09:34 »
我是用 OpenVPN 連到公司內網,一開始我還在頭痛,這個要怎麼設啊?

結果這位 Arno 大哥的 FAQ 真的很神,

Q: How can I use OpenVPN with your firewall?
A: Here's how you should do it.
You need to configure the following variables:
  • TRUSTED_IF="tun+"
  • OPEN_UDP="1194"

首先,在 /etc/arno-iptables-firewall/custom-rules 加上TRUSTED_IF="tun+"
為甚麼要加在這呢?因為 debconf.cfg 會被設定的 script 重寫。如果你又重新設定時,這個設定 script 沒有寫到 vpn 的設定,所以會被蓋掉。

你寫在 custom-rules 就不會被蓋掉了。

至於 OPEN_UDP="1194" ,我是寫在 debconf.cfg 裡面,跟其他開放的 UDP port 寫在一起。

9
AIF 要封鎖特定 IP 也很簡單,不過 Debian Squeeze 版的 AIF 是 1.9 版,不是最新版 2.0.1 ,所以 /etc/arno-iptables-firewall/firewall.conf 這個檔案有些動作要作。


  • #BLOCK_HOSTS_FILE="/etc/arno-iptables-firewall/blocked-hosts"
    這一行的 "#" 要拿掉。
  • DISABLE_IPTABLES_BATCH=0
    這裡 0 要改為 1

以上兩點我是 google 來的,沒有在作者的 FAQ 裡面。

其他的作者本人的網站有 FAQ,

http://rocky.eld.leidenuniv.nl/joomla/index.php?option=com_content&view=article&id=50&Itemid=81

寫得很清楚,只是用英文寫的。

Q: What's the proper way to use the blocked hosts file?
A: Just put the hostname or IP of the host(s) you want to block in "/etc/iptables-blocked-hosts" (default location). You can use comments (starting with the #-character) but it can only be used when the whole line is a comment!

基本上只要把你要封鎖的 IP 寫在 "/etc/iptables-blocked-hosts" 一個 IP 一行。"#" 起頭的行為註解。寫完之後,重啟服務就好了。

要封鎖一個網段

Q: How can I use IP address ranges in the configuration file and/or the block hosts file?
A: Version 1.8 does NOT support IP ranges (except for the blocked hosts file), and never will. However starting with version 1.9, you can use class C IPv4 ranges like ie. 192.168.1.10-20, which would include all IP's between 192.168.1.10 en 192.168.1.20.

就像這樣啦,你打 192.168.1.10-20 ,它就封鎖 192.168.1.10 到 192.168.1.20.
有沒有簡單?

10
KaLUG 討論版 / Debian - 防火牆 script
« 於: 2012-03-01 08:59 »
最近發現一個設立防火牆的好東西叫做 arno-iptables-firewall,簡稱 AIF。我在本站搜尋沒有發現,所以特地貼上給大家參考參考。

http://rocky.eld.leidenuniv.nl/joomla/

這位 arno 先生的東西大多數用 shell script 寫成,簡直到了爐火純青的地步。想學 shell script 可以參考他的其他作品。

我是用 Debian 裝的,裝完之後回答一些問題就裝好了。就算沒回答好也沒關係,它的設定檔不到十行。

/etc/arno-iptables-firewall/debconf.cfg

DC_EXT_IF="eth0" 外部網卡
DC_EXT_IF_DHCP_IP=0 外網 IP 是不是 DHCP 取得
DC_OPEN_TCP="21,25 ... 其他你想開的埠"
DC_OPEN_UDP="53,111,138 ...其他你想開的埠 "
DC_INT_IF="eth1" 內部網卡
DC_NAT=1 要不要 nat
DC_INTERNAL_NET="192.168.100.0/24" 內網網段
DC_NAT_INTERNAL_NET="192.168.100.0/24" nat 網段
DC_OPEN_ICMP=0 給不給 ping

改完之後,service arno-iptables-firewall restart 就好了。

唯一的缺點是 ... 大哥,你取的 service 名稱也太長一點了吧!

11
KaLUG 討論版 / Re: 開版宣言
« 於: 2012-03-01 08:44 »
Sorry! 本版已經不使用了!

Kalug 請到 http://kalug.linux.org.tw/

目前利用本版作一些 Debian 的筆記。

12
KaLUG 討論版 / 回覆: 你用 Debian 的理由
« 於: 2011-06-01 16:51 »
建議你去摩托學園看看,這邊只是我自己的備忘錄。

當然也歡迎討論啦!只是這個版人比較少。

13
我是參考這裡

http://kernel-handbook.alioth.debian.org/ch-initramfs.html

我覺得這個 project 不錯。我沒有照書面作,不過裡面的資料也很有參考價值。

14
KaLUG 討論版 / Debian - mkinitramfs (舊 mkinitrd)
« 於: 2011-02-23 13:05 »
當你使用 SCSI 硬碟開機的時候,需要預先載入 SCSI module 到 initrd.img-KERNEL-VERSION 這個檔裡面。
今天升級了 kernel ,我有個習慣,升級了kernel馬上就重開機。結果機器果然開不了。

還好還有安裝光碟,安裝光碟也就是緊急開機光碟。光碟一放進去,還沒重開機,機器就開好了,然後就出現熟悉的 Login 畫面了。

然後我想用 mkinitrd ,卻發現沒有這個指令。查了查文件後有幾點:

1. kernel 2.6.13 之後,改用 mkinitramfs。
2. 修改 /etc/initramfs-tools/modules ,加入自己想要預載的 SCSI driver
  (我加了 scsi_mod, sd_mod, aic7xxx)

3. 執行 update-initramfs -u  (-u update an existing ramfs, 如果你要保留舊的請自行查閱 man update-initramfs)

4. 檢查 /boot/initrd.imgXXX ,你會發現有一個新檔,舊檔被自動備份為 initrd.imgXXX.bak

5.reboot for test

15
KaLUG 討論版 / Debian 變更時區 localtime
« 於: 2010-12-15 14:28 »
dpkg-reconfigure tzdata

然後選 Asia , 再選 Taipei 。

17
http://www.upfrontsystems.co.za/Members/izak/sysadman/an-iptables-fix-for-dictionary-spam-tactics

這個看起來最適合

代碼: [選擇]
iptables -N block_spammers
iptables -A block_spammers -p tcp --dport smtp -m recent --set --name MAIL
iptables -A block_spammers -p tcp --dport smtp -m recent --update --seconds 30 --hitcount 4 --name MAIL -j DROP
iptables -I INPUT 1 -i eth0 -m state --state NEW -j block_spammers


18
KaLUG 討論版 / 回覆: 你用 Debian 的理由
« 於: 2010-02-22 14:42 »
lloyd老大,

還是你比較有系統。我說一件事情都會 2266。

19
這個不錯!

不過大家可以參考下面這個,我也正在試。基本上這樣可以在防火牆擋下來,根本不讓封包碰到 postfix。範例是 22 port,可以改成任何 port。

原稿:http://lists.centos.org/pipermail/centos/2008-January/051102.html

引用
To deal with brute force attacks (not just on ssh) I spent some time tracking
down how others had dealt with the problem. I discovered thereby that one can
use the simple linux firewall iptables to restrict the number of connections
to a given port from a single source over a specified interval. I therefore
added these rules to my /etc/sysconfig/iptables file:
代碼: [選擇]
...
# This is usually present in all setups but, you never know....
# Established connections go right through.
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
...

# Block brute force attacks
# Drop repeated ssh connection attempts within 20 seconds interval
-A RH-Firewall-1-INPUT -p tcp -m tcp -m state -m recent -i eth0 --dport 22
--state NEW -j DROP  --rcheck --seconds 20 --name THROTTLE --rsource

# Accept ssh connection if not attempted within past 20 sec.
-A RH-Firewall-1-INPUT -p tcp -m tcp -m state -m recent -i eth0 --dport 22
--state NEW -j ACCEPT  --set --name THROTTLE --rsource
You can change the interval from 20 seconds to whatever you feel represents a
decent compromise between user satisfaction and security.  Many authorities
considered a value between 3 and 6 seconds sufficient to render brute force
attacks impractical.  These rules can be trivially modified to protect any
destination port (-dport 21 for ftp for instance) or protocol (-p udp).

firewall 我不太懂,請懂的人幫我檢查一下。

20
KaLUG 討論版 / Debian: iptables 設定
« 於: 2010-02-12 16:36 »
per

http://nixcraft.com/linux-software/953-iptables-under-debian.html

Type the following commands:

代碼: [選擇]
iptables-save > /root/dsl.fw
Load iptables rules


代碼: [選擇]
vi /etc/network/interfaces
Append following line to eth0


代碼: [選擇]
post-up iptables-restore < /root/dsl.fw
Save the file. Reboot the system
__________________
Vivek Gite
Linux Evangelist

21
原文

http://forums.debian.net/viewtopic.php?f=7&t=40500


不能用的主要原因是:wireless 的 firmware 是 non-free 所以要自己動手。

基本上步驟是這樣的:

1. 修改 /etc/apt/sources.list ,在有 deb 開頭行的後面加上 non-free。如: deb http://xxx.xxx.xxx/debian lenny main contrib non-free
2. apt-get update
3. apt-get install firmware-ralink wireless-tools
4. iwconfig 你應該可以看到 wlan0 的訊息表示驅動程式已經載好

設定方面待續

22
KaLUG 討論版 / 回覆: L10N 的筆記 2 流程
« 於: 2009-08-27 14:34 »
http://www.gnu.org/software/gettext/manual/html_node/Overview.html#Overview


  • 使用 xgettext 取出 PACKAGE.pot ,也就是 po 的範本檔
  • 使用 msgmerge 將先前版本的 po ,也就先前翻譯的名詞灌到 PACKAGE.pot 成為新的 PACKAGE.po
  • 檢查 PACKAGE.po 中沒有翻譯的部份,然後手工翻譯。
  • 完成翻譯後,使用 msgfmt 將 .po 轉成 .gmo
  • 安裝的時候記得將 .gmo 改成 .mo

23
KaLUG 討論版 / L10N 的筆記
« 於: 2009-08-27 14:25 »
原文 http://www.gnu.org/software/gettext/manual/html_node/Files.html#Files

po ︰Portable Object 可移植物件
mo :Machine Object 機器碼物件

這是來自於 NLS 標準,首先用在 SUN Solaris 系統

po 是人可以直接閱讀與編輯,最好用 xgettext 產生,然後使用 msgmerge 更新
副檔名 pot 是空的 po 檔 也就是 po 的 template

mo 是二進位機器碼,隨機器不同需要重新編譯。
有些系統不支援 GNU gettext ,使用 GNU 工具編出來的使用副檔名 .gmo 來識別。 .gmo 也是不折不扣的 mo 檔。

24
原文請見 http://wiki.debian.org/ipw2200

Intel PRO/Wireless 2200 802.11bg 這張卡的 Firmware 不是 free 的,所以要

1.Add a "non-free" component to /etc/apt/sources.list, for example:
在 /etc/apt/sources.list 新增 "non-free" 的套件庫,例如 ...
代碼: [選擇]
# Debian Lenny/5.0
deb http://ftp.us.debian.org/debian lenny main contrib non-free

2.Update the list of available packages and install the firmware-ipw2x00 and wireless-tools packages:
更新套件清單並安裝 firmware-ipw2x00 和 wireless-tools 套件
代碼: [選擇]
aptitude update
aptitude install firmware-ipw2x00 wireless-tools

You are required to accept the license agreement before the firmware is installed to your system.
安裝後須同意 firmware 的使用條件,基本上是說:這只能用在 INTEL 的設備上...

3 As the driver may already be loaded, reinsert the relevant driver module to access installed firmware:
當安裝好新的驅動程式後,請重新載入無線網卡模組

代碼: [選擇]
modprobe -r ipw2100 ; modprobe ipw2100這是比較舊的卡

或者

代碼: [選擇]
modprobe -r ipw2200 ; modprobe ipw2200
我的小白是用這張啦

4. Verify your device has an available interface:
確認網卡已可使用
代碼: [選擇]
iwconfig
5. Raise the interface to activate the radio, for example:
啟動網路卡
代碼: [選擇]
ifconfig wlan0 up
6. Configure your wireless interface as appropriate.
設定無線網路卡


如有疑問請查原文網址 http://wiki.debian.org/ipw2200

25
KaLUG 討論版 / 回覆: Debian : PXE boot 安裝
« 於: 2009-08-15 18:07 »
抄錯版本了,

etch 是 4.0 版
lenny 才是 5.0 版,所以 etch 的地方要改成 lenny

26
KaLUG 討論版 / 回覆: Debian: 網路設定
« 於: 2009-08-10 20:42 »
/etc/network/interfaces

代碼: [選擇]
auto eth0
要加這行,restart 或 start 才會自動設定

但奇怪的是沒有這行重開機的時候也行!

27
大學畢業後就沒在用了,我特地下載了 gfortran -- FORTRAN 95 compiler 試了一下

第一行的 PROGRAM MAIN 和 IF(...) 都要內縮,因為 1-6 只能放 LABEL ,這樣就編的過了。
至於程式邏輯我沒看。

28
man 5 crontab

引用
If MAILTO is defined (and non-empty), mail is sent to  the  user so  named. If  MAILTO  is defined but empty (MAILTO=""), no mail will be sent.

29
肉腳版 / 回覆: 何謂正統Linux.........
« 於: 2009-08-10 18:36 »
正統不正統,無關緊要。

但是可以檢驗的是有沒有遵循標準。
為什麼 ls 這個指令可以從 1970 unix 誕生用到現在?
那就是因為要遵循 POSIX 這個標準。

換句話說︰要是使用了自創標準的版本開發軟體,就像在地基不穩的基礎上蓋大樓。有風險。

30
我也不知道為什麼,不過我都這樣寫

代碼: [選擇]
10 19 * * * /bin/sh xxxxxx.sh
我猜是 cron 是一個很簡單的 shell ,簡單到連 PATH 也都沒設

頁: [1] 2 3 ... 12