Category Archives: Linux

[Debian]修改sources.list

vi /etc/apt/sources.list

將內容改成

deb http://ftp.tw.debian.org/debian/ lenny main non-free contrib deb-src http://ftp.tw.debian.org/debian/ lenny main non-free contrib

deb http://security.debian.org/ lenny/updates main contrib non-free deb-src http://security.debian.org/ lenny/updates main contrib non-free

deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free deb-src http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free

如果是個人使用,改成testing的方式,除了可享用最新的套件外,也可以安裝到很多新套件(server的話不建議,套件雖舊但絕對穩定) 修改如下(必須要將stable加入,因為有些套件只有在stable裡頭有):

deb http://ftp.tw.debian.org/debian/ stable main contrib non-free deb http://ftp.tw.debian.org/debian/ testing main contrib non-free deb-src http://ftp.tw.debian.org/debian/ …

Continue Reading

[Debian]openssh-server安裝及設定

安裝:

aptitude install openssh-server /etc/init.d/ssh start

(需使用CD-ROM或掛載映像檔安裝)

設定:

vi /etc/ssh/sshd_config PermitRootLogin no (重要!!!!) AllowUsers salamander ychsiao ken (非必要) LoginGraceTime 30 (密碼輸入時限為 30 秒) MaxAuthTries 2 (最多只能輸入2 次密碼) ClientAliveInterval 300 (300秒後自動登出)

Continue Reading

[Debian]root password reset

方法一:

boot liveCD (5.02 liveCD ok!) sudo -i mkdir temp mount /dev/sda1 temp cd temp/etc vi shadow (讓第一行root的第二個欄位變成空白empty) reboot

方法二:

reboot grub 畫面按 e 在kenel行末端加入 init=/bin/bash (kernel那一行是linx /boot/vmlinuz-2.6…..) control-x (此行指令執行開機) mount -n -o remount,rw / mount -avt nonfs,noproc,nosmbfs passwd root reboot

Continue Reading

[Debian]pure-ftp安裝

(安裝前請先將Debian UTF-8化)

wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.27.tar.gz tar -zxvf pure-ftpd-1.0.27.tar.gz cd pure-ftpd-1.0.27 (./configure –help可看到所有的參數,依照實際情況來加) aptitude install libssl-dev ./configure –with-tls –with-diraliases –with-altlog –with-sysquotas -with-quotas –with-throttling –with-ratios –with-ftpwho –with-rfc2640 make install-strip cd configuration-file perl pure-config.pl pure-ftpd.conf (啟動服務) 服務重啟前先 pkill pure-ftpd (將process刪除) 之後再啟動服務

Continue Reading

[Debian]UTF-8化

1. vi /etc/locale.gen

2. 增加下面這幾個 en_US ISO-8859-1 en_US.UTF-8 UTF-8 zh_TW BIG5 zh_TW.UTF-8 UTF-8

3. 輸入locale-gen

4. vi ~/.bashrc

5. 增加下面這幾行 export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8

6. 重新登入

Continue Reading