修正版 : 2.06 (最後修改日期 2005年五月二十六號) - 更新紀錄
原文網站 : http://www.ubuntuguide.org
翻譯網站 : http://tw.ubuntuguide.org 鏡像站
作者 : Chua Wen Kiat (吉隆坡, 馬來西亞)
譯者 : whisky (巴黎, 法國), SSH (台北,台灣)
Copyright (C) 2004-2005 http://www.ubuntuguide.org
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
wget -c http://ubuntuguide.org/ubuntu5.04.tar.gz tar zxvf ubuntu5.04.tar.gz
Q: 如何新增其他的套件庫 (extra Repositories)?
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup sudo gedit /etc/apt/sources.list
... ## Uncomment the following two lines to fetch updated software from the network # deb http://us.archive.ubuntu.com/ubuntu hoary main restricted # deb-src http://us.archive.ubuntu.com/ubuntu hoary main restricted ## Uncomment the following two lines to fetch major bug fix updates produced ## after the final release of the distribution. # deb http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted # deb-src http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted ## Uncomment the following two lines to add software from the 'universe' ## repository. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu Security ## team. # deb http://us.archive.ubuntu.com/ubuntu hoary universe # deb-src http://us.archive.ubuntu.com/ubuntu hoary universe # deb http://security.ubuntu.com/ubuntu hoary-security main restricted # deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted # deb http://security.ubuntu.com/ubuntu hoary-security universe # deb-src http://security.ubuntu.com/ubuntu hoary-security universe
## Uncomment the following two lines to fetch updated software from the network deb http://us.archive.ubuntu.com/ubuntu hoary main restricted deb-src http://us.archive.ubuntu.com/ubuntu hoary main restricted ## Uncomment the following two lines to fetch major bug fix updates produced ## after the final release of the distribution. deb http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted ## Uncomment the following two lines to add software from the 'universe' ## repository. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu Security ## team. deb http://us.archive.ubuntu.com/ubuntu hoary universe deb-src http://us.archive.ubuntu.com/ubuntu hoary universe deb http://security.ubuntu.com/ubuntu hoary-security main restricted deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted deb http://security.ubuntu.com/ubuntu hoary-security universe deb-src http://security.ubuntu.com/ubuntu hoary-security universe deb http://archive.ubuntu.com/ubuntu hoary multiverse deb-src http://archive.ubuntu.com/ubuntu hoary multiverse deb ftp://ftp.nerim.net/debian-marillat stable main deb ftp://ftp.nerim.net/debian-marillat unstable main deb ftp://ftp.nerim.net/debian-marillat testing main
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 1F41B907 gpg --armor --export 1F41B907 | sudo apt-key add - sudo apt-get update
Q: 如何新增 backports 的套件庫 (Repositories) (選擇性)?
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup sudo gedit /etc/apt/sources.list
deb http://backports.ubuntuforums.org/ubp hoary-backports main universe multiverse restricted deb http://backports.ubuntuforums.org/ubp hoary-extras main universe multiverse restricted
sudo apt-get update
Q: 如何備份/恢復已經下載的套件庫 (Repositories) 的 cache?
mkdir -p $HOME/backup/var/lib/ sudo cp -R /var/lib/apt/ $HOME/backup/var/lib/ mkdir -p $HOME/backup/var/cache/ sudo cp -R /var/cache/apt/ $HOME/backup/var/cache/ mkdir -p $HOME/backup/etc/apt sudo cp -R /etc/apt/ $HOME/backup/etc/ sudo chown -R $USER $HOME/backup/
sudo cp -fR $HOME/backup/var/* /var/ sudo cp -fR $HOME/backup/etc/apt/* /etc/apt/
sudo apt-get update sudo apt-get upgrade
wget -c http://frankandjacq.com/ubuntuguide/smeg_0.5-0ubuntu1_all.deb sudo dpkg -i smeg_0.5-0ubuntu1_all.deb
wget -c http://frankandjacq.com/ubuntuguide/gnome-clipboard-daemon-1.0.bin.tar.bz2 sudo tar jxvf gnome-clipboard-daemon-1.0.bin.tar.bz2 -C /usr/bin/ sudo chown root:root /usr/bin/gnome-clipboard-daemon sudo chmod 755 /usr/bin/gnome-clipboard-daemon sudo gnome-clipboard-daemon &
Startup Programs 分頁 -> Add Startup Command: gnome-clipboard-daemon Order: 80
Q: 如何安裝 J2SE Runtime Environment (JRE) 和 Mozilla FireFox 使用的外掛?
wget -c http://frankandjacq.com/ubuntuguide/jre-1_5_0_03-linux-i586.bin sh jre-1_5_0_03-linux-i586.bin sudo mkdir /usr/java sudo mv jre1.5.0_03/ /usr/java/ sudo chown -R root:root /usr/java/jre1.5.0_03/ sudo ln -fs /usr/java/jre1.5.0_03/bin/java /usr/bin/java sudo ln -fs /usr/java/jre1.5.0_03/bin/java_vm /usr/bin/java_vm sudo ln -fs /usr/java/jre1.5.0_03/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/ sudo ln -fs /usr/java/jre1.5.0_03/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla-firefox/plugins/ java -version
Q: 如何安裝 Mozilla FireFox 的 Flash Player (Macromedia Flash) 外掛?
sudo apt-get install flashplayer-mozilla
Q: 如何安裝 PDF 閱讀程式 (Adobe Reader) 和 Mozilla FireFox 使用的外掛?
sudo apt-get install acroread sudo apt-get install mozilla-acroread
sudo apt-get install d4x
sudo apt-get install gftp
Q: 如何安裝 P2P BitTorrent 後端程式 (Azureus)?
wget -c http://frankandjacq.com/ubuntuguide/Azureus_2.3.0.0_linux.GTK.tar.bz2 sudo apt-get install libswt-gtk3-java sudo tar jxvf Azureus_2.3.0.0_linux.GTK.tar.bz2 -C /opt/ sudo chown -R root:root /opt/azureus/ sudo gedit /usr/share/applications/Azureus.desktop
[Desktop Entry] Name=Azureus Comment=Azureus Exec=/opt/azureus/azureus Icon=/opt/azureus/Azureus.png Terminal=false Type=Application Categories=Application;Network;
Q: 如何安裝 P2P eMule 後端程式 (aMule)?
sudo apt-get install amule
Q: 如何安裝 P2P Gnutella 後端程式 (LimeWire)?
wget -c http://frankandjacq.com/ubuntuguide/LimeWireSoftOther.zip sudo unzip -u LimeWireSoftOther.zip -d /opt/ sudo chown -R root:root /opt/LimeWire/ sudo gedit /usr/bin/runLime.sh
cd /opt/LimeWire/ ./runLime.sh
sudo chmod +x /usr/bin/runLime.sh sudo gedit /usr/share/applications/LimeWire.desktop
[Desktop Entry] Name=LimeWire Comment=LimeWire Exec=runLime.sh Icon=/opt/LimeWire/LimeWire.ico Terminal=false Type=Application Categories=Application;Network;
sudo apt-get install libqt3c102-mt wget -c http://frankandjacq.com/ubuntuguide/skype_1.1.0.3-1_i386.deb sudo dpkg -i skype_1.1.0.3-1_i386.deb
sudo apt-get install linpopup sudo gedit /usr/share/applications/linpopup.desktop
[Desktop Entry] Name=LinPopUp Comment=LinPopUp Exec=linpopup Icon=/usr/share/pixmaps/linpopup.xpm Terminal=false Type=Application Categories=Application;Utility;
wget -c http://frankandjacq.com/ubuntuguide/gstreamer0.8-lame_0.8.8-0.1_i386.deb sudo apt-get install gstreamer0.8-plugins sudo apt-get install w32codecs sudo apt-get install liblame0 sudo dpkg -i gstreamer0.8-lame_0.8.8-0.1_i386.deb gst-register-0.8
sudo apt-get install libdvdcss2
sudo apt-get install xine-ui
Q: 如何安裝多媒體播放器 (MPlayer) 和 Mozilla FireFox 使用的外掛?
sudo apt-get -t hoary install mplayer-386 sudo apt-get -t hoary install mplayer-fonts sudo apt-get -t hoary install mozilla-mplayer sudo cp /etc/mplayer/mplayer.conf /etc/mplayer/mplayer.conf_backup sudo gedit /etc/mplayer/mplayer.conf
... vo=x11, # To specify default video driver (see -vo help for ...
vo=xv, # To specify default video driver (see -vo help for
sudo apt-get install xmms wget -c http://frankandjacq.com/ubuntuguide/xmms-wma_1.0.4-2_i386.deb sudo dpkg -i xmms-wma_1.0.4-2_i386.deb
wget -c http://frankandjacq.com/ubuntuguide/realplay-10.0.4.750-linux-2.2-libc6-gcc32-i586.bin chmod +x realplay-10.0.4.750-linux-2.2-libc6-gcc32-i586.bin sudo ./realplay-10.0.4.750-linux-2.2-libc6-gcc32-i586.bin ... Enter the complete path to the directory 何處 you want RealPlayer to be installed. You must specify the full pathname of the directory and have write privileges to the chosen directory. Directory: [/home/chua/RealPlayer]: /opt/RealPlayer You have selected the following RealPlayer configuration: Destination: /opt/RealPlayer Enter [F]inish to begin copying files, or [P]revious to go back to the previous prompts: [F]: F Copying RealPlayer files...configure system-wide symbolic links? [Y/n]: Y enter the prefix for symbolic links [/usr]: /usr ...
Q: 如何安裝 Stream Directory Browser (streamtuner)?
sudo apt-get install streamtuner
sudo apt-get install kino
sudo apt-get install audacity
Q: 如何安裝 DVD Ripper (dvd::rip)?
sudo apt-get -t testing install transcode sudo apt-get install dvdrip sudo gedit /usr/share/applications/dvdrip.desktop
[Desktop Entry] Name=dvd::rip Comment=dvd::rip Exec=dvdrip Icon=/usr/share/perl5/Video/DVDRip/icon.xpm Terminal=false Type=Application Categories=Application;AudioVideo;
sudo apt-get install goobox sudo rm -f /usr/share/applications/goobox.desktop sudo gedit /usr/share/applications/goobox.desktop
[Desktop Entry] Name=CD Player & Ripper Comment=Play and extract CDs Exec=goobox Icon=goobox.png Terminal=false Type=Application Categories=Application;AudioVideo;
Q: 如何安裝 Email 後端程式 (Mozilla Thunderbird)?
sudo apt-get install mozilla-thunderbird
sudo apt-get install pan
Q: 如何安裝 RSS/RDF/Atom Newsreader (RSSOwl)?
wget -c http://frankandjacq.com/ubuntuguide/rssowl_linux_1_1_1_bin.tar.gz sudo tar zxvf rssowl_linux_1_1_1_bin.tar.gz -C /opt/ sudo chown -R root:root /opt/rssowl_linux_1_1_1_bin/ sudo gedit /usr/bin/runRSSOwl.sh
export MOZILLA_FIVE_HOME=/usr/lib/mozilla-firefox export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH} cd /opt/rssowl_linux_1_1_1_bin/ ./run.sh
sudo chmod +x /usr/bin/runRSSOwl.sh sudo gedit /usr/share/applications/RSSOwl.desktop
[Desktop Entry] Name=RSSOwl Comment=RSSOwl Exec=runRSSOwl.sh Icon=/opt/rssowl_linux_1_1_1_bin/rssowl.xpm Terminal=false Type=Application Categories=Application;Network;
wget -c http://frankandjacq.com/ubuntuguide/nvu-1.0PR-pc-linux2.6.10-gnu.tar.bz2 sudo tar jxvf nvu-1.0PR-pc-linux2.6.10-gnu.tar.bz2 -C /opt/ sudo chown -R root:root /opt/nvu-1.0PR/ sudo gedit /usr/share/applications/Nvu.desktop
[Desktop Entry] Name=Nvu Comment=Nvu Exec=/opt/nvu-1.0PR/nvu Icon=/opt/nvu-1.0PR/icons/mozicon50.xpm Terminal=false Type=Application Categories=Application;Office;
sudo apt-get install planner
Q: 如何安裝桌面排版系統 (Desktop Publishing) 應用程式 (Scribus)?
sudo apt-get install scribus
sudo apt-get install dia-gnome
Q: 如何安裝 CD/DVD 燒錄軟體 (GnomeBaker)?
sudo apt-get install gnomebaker
Q: 如何安裝 ADSL/PPPoE 撥接程式 (RP-PPPoE)?
wget -c http://frankandjacq.com/ubuntuguide/rp-pppoe-3.5.tar.gz sudo tar zxvf rp-pppoe-3.5.tar.gz -C /opt/ sudo chown -R root:root /opt/rp-pppoe-3.5/ sudo gedit /usr/share/applications/RP-PPPoE.desktop
[Desktop Entry] Name=RP-PPPoE Comment=RP-PPPoE Exec=gksudo /opt/rp-pppoe-3.5/go-gui Icon= Terminal=false Type=Application Categories=Application;System;
Q: 如何安裝系統啟動程序管理程式 BootUp Manager (UBM)?
wget -c http://frankandjacq.com/ubuntuguide/ubm_1.2.5-0ubuntu1_all.deb sudo dpkg -i ubm_1.2.5-0ubuntu1_all.deb
sudo apt-get install gparted
sudo apt-get install firestarter
sudo apt-get install nessus sudo apt-get install nessusd sudo nessus-adduser sudo ln -fs /etc/init.d/nessusd /etc/rc2.d/S20nessusd sudo /etc/init.d/nessusd start sudo gedit /usr/share/applications/Nessus.desktop
[Desktop Entry] Name=Nessus Comment=Nessus Exec=nessus Icon= Terminal=false Type=Application Categories=Application;System;
sudo apt-get install rar sudo ln -fs /usr/bin/rar /usr/bin/unrar
sudo apt-get install xfonts-intl-arabic sudo apt-get install xfonts-intl-asian sudo apt-get install xfonts-intl-chinese sudo apt-get install xfonts-intl-chinese-big sudo apt-get install xfonts-intl-european sudo apt-get install xfonts-intl-japanese sudo apt-get install xfonts-intl-japanese-big sudo apt-get install xfonts-intl-phonetic sudo apt-get install gsfonts-x11 sudo apt-get install msttcorefonts sudo fc-cache -f -v
sudo apt-get install scim sudo apt-get install scim-chinese sudo apt-get install scim-config-socket sudo apt-get install scim-gtk2-immodule sudo apt-get install scim-tables-zh wget -c http://frankandjacq.com/ubuntuguide/fireflysung-1.3.0.tar.gz sudo tar zxvf fireflysung-1.3.0.tar.gz -C /usr/share/fonts/truetype/ sudo chown -R root:root /usr/share/fonts/truetype/fireflysung-1.3.0/ sudo fc-cache -f -v
按下 'Ctrl + Space'
Q: 如何安裝桌面小程式 (Desktop Applets) (gDesklets)?
sudo apt-get install gdesklets sudo apt-get install gdesklets-data
sudo apt-get install frozen-bubble
Q: 如何安裝基本的編輯工具 (build-essential)?
sudo apt-get install build-essential
Q: 如何安裝 Windows 9X/ME/2000/XP (Win4Lin)?
Q: 如何安裝 Windows 的應用程式 (CrossOver Office)?
sudo apt-get install nvidia-glx sudo apt-get install nvidia-settings sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup sudo nvidia-glx-config enable sudo gedit /usr/share/applications/NVIDIA-Settings.desktop
[Desktop Entry] Name=NVIDIA Settings Comment=NVIDIA Settings Exec=nvidia-settings Icon= Terminal=false Type=Application Categories=Application;System;
Q: 如何取消 GNOME 啟動時顯示的 NVIDIA 圖形 LOGO?
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup sudo gedit /etc/X11/xorg.conf
... Section "Device" Identifier "NVIDIA Corporation NV11 [GeForce2 MX/MX 400]" Driver "nvidia" BusID "PCI:1:0:0" ...
Option "NoLogo"
wget -c http://frankandjacq.com/ubuntuguide/scanModem.gz gunzip -c scanModem.gz > scanModem chmod +x scanModem sudo ./scanModem gedit Modem/ModemData.txt
Q: 如何安裝 Modem 的驅動程式 (SmartLink)?
uname -r (must be 2.6.10-5-386) wget -c http://frankandjacq.com/ubuntuguide/sl-modem-modules-2.6.10-5-386_2.9.9a-1ubuntu2+2.6.10-34_i386.deb sudo dpkg -i sl-modem-modules-*.deb sudo apt-get install sl-modem-daemon
sudo gedit /etc/udev/rules.d/10-custom.rules
BUS="usb", SYSFS{product}="Palm Handheld*", KERNEL="ttyUSB*", NAME{ignore_remove}="pilot", MODE="666"
sudo fdisk -l
df -T -h
mount
lspci
lsusb
例如 假設 /dev/cdrom 是目前 CD/DVD-ROM 所在的位置
sudo hdparm -d1 /dev/cdrom sudo cp /etc/hdparm.conf /etc/hdparm.conf_backup sudo gedit /etc/hdparm.conf
/dev/cdrom { dma = on }
Q: 如何手動掛載/卸除 CD/DVD-ROM, 並顯示所有隱藏的和相關的檔案和檔案夾?
例如 假設 /media/cdrom0/ 是目前 CD/DVD-ROM 所在的位置
sudo mount /media/cdrom0/ -o unhide
sudo umount /media/cdrom0/
例如 假設 /media/cdrom0/ 是目前 CD/DVD-ROM 所在的位置
sudo umount /media/cdrom0/ -l
sudo mount -a
Connections 分頁 -> 選擇 "Ethernet connection" -> Activate/Deactivate
Connections 分頁 -> 選擇 "Ethernet connection" -> Properties Connection -> This device is configured (勾選) Connection Settings -> Configuration: 選擇 "DHCP/Static IP address" DNS 分頁 -> DNS Servers -> Add/Delete
General 分頁 -> Host Settings -> Hostname: 在此設定電腦名稱
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... server string = %h server (Samba, Ubuntu) ...
server string = new_computer_descriptions
sudo testparm sudo /etc/init.d/samba restart
Q: 如何更改電腦的 網域名稱 (Domain)/群組名稱 (Workgroup)?
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... workgroup = MSHOME ...
workgroup = new_domain_or_workgroup
sudo testparm sudo /etc/init.d/samba restart
Q: 如何在使用 DynDNS 的服務和動態 IP 的情況下指定主機名稱 (Hostname)?
例如 假設您的網路連線已經正確設定好 並在 http://www.dyndns.org 註冊好動態的DNS 每小時自動向 DynDNS 的資料庫/DNS 更新您的 IP 設定 * * * * * 分別代表 分 時 日 月 年
sudo apt-get install ipcheck sudo gedit /root/dyndns_update.sh
USERNAME=myusername PASSWORD=mypassword HOSTNAME=myhostname.dyndns.org cd /root/ if [ -f /root/ipcheck.dat ]; then ipcheck -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME else ipcheck --makedat -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME fi
sudo chmod 700 /root/dyndns_update.sh sudo sh /root/dyndns_update.sh export EDITOR=gedit && sudo crontab -e
00 * * * * sudo sh /root/dyndns_update.sh
用滑鼠又按鈕點選檔案夾 -> Share folder Shared folder -> Share with: 選擇 "SMB" Share properties -> Name: Specify the share name
例如 假設您的網路連線已經正確設定好 If computers or network folders could not be found, try access them directly 請參閱 如何不先掛載就讀取網路分享檔案夾?
例如 假設您的網路連線已經正確設定好 網路主機的 IP: 192.168.0.1 分享中的檔案夾名稱: linux
smb://192.168.0.1/linux
Q: 如何手動掛載/卸除網路共享檔案夾, 並允許所有使用者都可讀取 ?
例如 假設您的網路連線已經正確設定好 網路主機的 IP: 192.168.0.1 網路主機的使用者名稱: myusername 網路主機的登錄密碼: mypassword 分享中的檔案夾名稱: linux 主機上要掛載的檔案夾: /media/sharename
sudo mkdir /media/sharename sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword
sudo umount /media/sharename/
Q: 如何手動掛載/卸除網路共享檔案夾, 並允許所有使用者都可讀取和寫入?
例如 假設您的網路連線已經正確設定好 網路主機的 IP: 192.168.0.1 網路主機的使用者名稱: myusername 網路主機的登錄密碼: mypassword 分享中的檔案夾名稱: linux 主機上要掛載的檔案夾: /media/sharename
sudo mkdir /media/sharename sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword,dmask=777,fmask=777
sudo umount /media/sharename/
Q: 如何在系統啟動時, 自動掛載網路分享檔案夾, 並允許所有使用者都可讀取 ?
例如 假設您的網路連線已經正確設定好 網路主機的 IP: 192.168.0.1 網路主機的使用者名稱: myusername 網路主機的登錄密碼: mypassword 分享中的檔案夾名稱: linux 主機上要掛載的檔案夾: /media/sharename
sudo mkdir /media/sharename sudo gedit /root/.smbcredentials
username=myusername password=mypassword
sudo cp /etc/fstab /etc/fstab_backup sudo gedit /etc/fstab
//192.168.0.1/linux /media/sharename smbfs credentials=/root/.smbcredentials 0 0
Q: 如何在系統啟動時, 自動掛載網路分享檔案夾, 並允許所有使用者都可讀取和寫入?
例如 假設您的網路連線已經正確設定好 網路主機的 IP: 192.168.0.1 網路主機的使用者名稱: myusername 網路主機的登錄密碼: mypassword 分享中的檔案夾名稱: linux 主機上要掛載的檔案夾: /media/sharename
sudo mkdir /media/sharename sudo gedit /root/.smbcredentials
username=myusername password=mypassword
sudo cp /etc/fstab /etc/fstab_backup sudo gedit /etc/fstab
//192.168.0.1/linux /media/sharename smbfs credentials=/root/.smbcredentials,dmask=777,fmask=777 0 0
Q: 如何手動掛載/卸除 Windows 的硬碟分割區 (NTFS), 並允許所有使用者只能讀取?
例如 假設 /dev/hda1 是目前 Windows 所在的分割區位置 (NTFS) 主機上要掛載的檔案夾: /media/windows
sudo mkdir /media/windows sudo mount /dev/hda1 /media/windows/ -t ntfs -o umask=0222
sudo umount /media/windows/
Q: 如何手動掛載/卸除 Windows 的硬碟分割區 (FAT), 並允許所有使用者都可讀取和寫入?
例如 假設 /dev/hda1 是目前 Windows 所在的分割區位置 (FAT) 主機上要掛載的檔案夾: /media/windows
sudo mkdir /media/windows sudo mount /dev/hda1 /media/windows/ -t vfat -o umask=000
sudo umount /media/windows/
Q: 如何在系統啟動時自動掛載 Windows 的硬碟分割區 (NTFS), 並允許所有使用者只能讀取?
例如 假設 /dev/hda1 是目前 Windows 所在的分割區位置 (NTFS) 主機上要掛載的檔案夾: /media/windows
sudo mkdir /media/windows sudo cp /etc/fstab /etc/fstab_backup sudo gedit /etc/fstab
/dev/hda1 /media/windows ntfs umask=0222 0 0
Q: 如何在系統啟動時自動掛載 Windows 的硬碟分割區 (FAT), 並允許所有使用者都可讀取和寫入?
例如 假設 /dev/hda1 是目前 Windows 所在的分割區位置 (FAT) 主機上要掛載的檔案夾: /media/windows
sudo mkdir /media/windows sudo cp /etc/fstab /etc/fstab_backup sudo gedit /etc/fstab
/dev/hda1 /media/windows vfat umask=000 0 0
sudo passwd root
sudo passwd -l root
Security 分頁 -> Options -> Allow root to login with GDM (勾選)
sudo -s -H Password: <在這註明您的密碼>
Users 分頁 -> Add User.../Properties/Delete
Groups 分頁 -> Add Group.../Properties/Delete
General 分頁 -> Automatic Login -> Login a user automatically on first bootup (勾選) Automatic login username: 選擇 "系統_使用者名稱"
export EDITOR=gedit && sudo visudo
system_username ALL=(ALL) ALL
Q: 如何使用 "sudo" 時不需要任何密碼提示 (沒有安全性)?
export EDITOR=gedit && sudo visudo
... system_username ALL=(ALL) ALL ...
system_username ALL=(ALL) NOPASSWD: ALL
sudo -K
滑鼠右按鈕點擊檔案s/folders -> Properties Permissions 分頁 -> Read/Write/Execute (勾選 the permissions for Owner/Group/Others)
sudo chown system_username /location_of_files_or_folders
sudo chgrp system_groupname /location_of_files_or_folders
Q: 我應該知道哪些關於 Ubuntu 系統安全的基本問題 ?
grub grub> md5crypt Password: ****** (ubuntu) Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password) grub> quit sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup sudo gedit /boot/grub/menu.lst
... ## password ['--md5'] passwd # If used in the first section of a menu file, disable all interactive editing # control (menu entry editor and command-line) and entries protected by the # command 'lock' # 例如 password topsecret # password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/ # password topsecret ...
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (這是編碼過的密碼)
... title Ubuntu, kernel 2.6.10-5-386 (recovery mode) root (hd0,1) kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro single initrd /boot/initrd.img-2.6.10-5-386 savedefault boot ...
#title Ubuntu, kernel 2.6.10-5-386 (recovery mode) #root (hd0,1) #kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro single #initrd /boot/initrd.img-2.6.10-5-386 #savedefault #boot
rm $HOME/.bash_history touch $HOME/.bash_history chmod 000 $HOME/.bash_history
Q: 如何在終端機模式下關閉 Ctrl+Alt+Del 的系統重新啟動功能?
sudo cp /etc/inittab /etc/inittab_backup sudo gedit /etc/inittab
... ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now ...
#ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
sudo telinit q
Q: 如何在終端機模式下進行 移除/覆蓋 檔案/資料夾 時,能有提示字串?
sudo cp /etc/bash.bashrc /etc/bash.bashrc_backup sudo gedit /etc/bash.bashrc
alias rm='rm -i' alias cp='cp -i' alias mv='mv -i'
Ubuntu, kernel 2.6.10-5-386 (recovery mode)
Q: 如何修改 kernal 開機參數, 來取得 root 帳號權限?
Ubuntu, kernel 2.6.10-5-386
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro quiet splash
grub edit> kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro quiet splash rw init=/bin/bash
Q: 如何使用 Ubuntu 的安裝 CD 來取得 root 帳號權限?
boot: rescue
Q: 如果忘記 root 帳號/主要帳號的密碼, 要如何重新設定密碼?
# passwd root
# passwd system_main_username
grub grub> md5crypt Password: ****** (ubuntu) Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password) grub> quit sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup sudo gedit /boot/grub/menu.lst
... password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/ ...
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password above)
Q: 在安裝完 Windows 後, 要如何恢復 GRUB 選單?
例如 假設 /boot 磁碟分割區位在 /dev/hda
# grub-install /dev/hda
Q: 如何在 GRUB 的選項中新增 Windows 這個項目?
例如 假設 /dev/hda1 是目前您的 Windows 所在的位置
$ sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup $ sudo gedit /boot/grub/menu.lst
title Microsoft Windows root (hd0,0) savedefault makeactive chainloader +1
Q: 如何在 Windows 下讀取 Linux 的分割區 (ext2, ext3)?
按下 'Ctrl + Alt + Backspace'或著
sudo /etc/init.d/gdm restart
Q: 如何在 GNOME 載入後就啟用鍵盤的 Num Lock (數字鍵)?
sudo apt-get install numlockx sudo cp /etc/X11/gdm/Init/Default /etc/X11/gdm/Init/Default_backup sudo gedit /etc/X11/gdm/Init/Default
... exit 0
if [ -x /usr/bin/numlockx ]; then /usr/bin/numlockx on fi
Startup Programs 分頁 -> Add/Edit/Delete
按下 'Ctrl + Alt + F1' (F2 - F6)
按下 'Ctrl + Alt + F7'
Q: 如何禁止在 GNOME 中使用 Ctrl+Alt+Backspace 來重新啟動 X?
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup sudo gedit /etc/X11/xorg.conf
Section "ServerFlags" Option "DontZap" "yes" EndSection
killall nautilus
killall gnome-panel
Q: 如何在同一個 Nautilus 視窗內開啟所有的檔案夾?
/ -> apps -> nautilus -> preferences -> always_use_browser (勾選)
按下 'Ctrl + H'
Edit 選單 -> Preferences Views 分頁 -> Default View -> Show hidden and backup files (勾選)
Q: 如何以 root 身份在 Nautilus 內瀏覽檔案和檔案夾?
sudo gedit /usr/share/applications/Nautilus-root.desktop
[Desktop Entry] Name=File Browser (Root) Comment=Browse the filesystem with the file manager Exec=gksudo "nautilus --browser %U" Icon=file-manager Terminal=false Type=Application Categories=Application;System;
Q: 如何顯示桌面圖示 (我的電腦, 家目錄, 資源回收桶)?
/ -> apps -> nautilus -> desktop -> computer_icon_visible (勾選) home_icon_visible (勾選) trash_icon_visible (勾選)
Q: 如何更改某個檔案在 "Open with" 中預設的程式?
滑鼠右按鈕點擊檔案 -> Properties Open With 分頁 -> Add 選擇 "Open with" program 選擇 "Open with" program (勾選)
Q: 如何改變預設的郵件程式為 Mozilla Thunderbird?
Mail Reader 分頁 -> Default Mail Reader -> Command: mozilla-thunderbird %s
gedit $HOME/.gnome2/nautilus-scripts/Open\ as\ root
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do gnome-sudo "gnome-open $uri" & done
chmod +x $HOME/.gnome2/nautilus-scripts/Open\ as\ root
滑鼠右按鈕點擊檔案 -> Scripts -> Open as root
Q: 如何停止 Terminal 模式下的 beep 音效?
Edit 選單 -> Current Profile... General 分頁 -> General -> Terminal bell (不勾選)
Q: 如何讓 Mozilla Firefox 能更快速的開啟網站?
在網址輸入行鍵入 -> about:config Filter (搜尋) : -> network.dns.disableIPv6 -> true network.http.pipelining -> true network.http.pipelining.maxrequests -> 8 network.http.proxy.pipelining -> true
Q: 如何關閉當 Mozilla Firefox 找到連接時的 beep 音效?
在網址輸入行鍵入 -> about:config Filter (搜尋) : -> accessibility.typeaheadfind.enablesound -> false
Q: 如何恢復 Mozilla Firefox 原本的圖示?
wget -c http://frankandjacq.com/ubuntuguide/mozilla-thunderbird.xpm chmod 644 mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-menu.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/default.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-menu.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/default.xpm
Q: 如何恢復 Mozilla Thunderbird 原本的圖示?
wget -c http://frankandjacq.com/ubuntuguide/mozilla-thunderbird.xpm chmod 644 mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-menu.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-menu.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm
Edit 選單 -> Reload Package Information
Edit 選單 -> Mark All Upgrades... -> Default Upgrade Edit 選單 -> 套用被標記的變動
Edit 選單 -> Search... 指定要搜尋的套件名稱
選擇 "package_name" Package 選單 -> 標記要安裝的套件 Edit 選單 -> 套用被標記的變動
選擇 "package_name" Package 選單 -> 標記要移除的套件 Edit 選單 -> 套用被標記的變動
sudo dpkg -i package_file.deb
sudo dpkg -r package_name
sudo alien package_file.rpm
wget -c http://frankandjacq.com/ubuntuguide/mvb_1.6.tgz sudo tar zxvf mvb_1.6.tgz -C /usr/ sudo chown -R root:root /usr/mvb_1.6/ sudo ln -fs /usr/mvb_1.6/mvb /usr/bin/mvb mvb -h
Q: 如何設定系統通用 (system-wide) 的環境變數?
sudo cp /etc/bash.bashrc /etc/bash.bashrc_backup sudo gedit /etc/bash.bashrc
man command | col -b > file.txt
md5sum file.iso > file.iso.md5
例如 假設 file.iso and file.iso.md5 are in the same folder
md5sum -c file.iso.md5
sudo mkdir /media/iso sudo modprobe loop sudo mount file.iso /media/iso/ -t iso9660 -o loop
sudo umount /media/iso/
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup sudo gedit /boot/grub/menu.lst
... #hiddenmenu ...
hiddenmenu
Q: 如何更改 GRUB menu 內關於開機時預設的等待時間 (timeout) ?
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup sudo gedit /boot/grub/menu.lst
... timeout 3 ...
timeout X_seconds
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup sudo gedit /boot/grub/menu.lst
... default 0 ...
default X_sequence
Q: 如何在系統啟動時顯示 GRUB menu 的 Splash Image?
例如 假設 hd0,1 是目前 Ubuntu 的啟動硬碟分割區
wget -c http://frankandjacq.com/ubuntuguide/ubuntu.xpm.gz chmod 644 ubuntu.xpm.gz sudo mkdir /boot/grub/images sudo cp ubuntu.xpm.gz /boot/grub/images/ sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup sudo gedit /boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8) # grub-install(8), grub-floppy(8), # grub-md5-crypt, /usr/share/doc/grub # and /usr/share/doc/grub-doc/. ...
splashimage (hd0,1)/boot/grub/images/ubuntu.xpm.gz
Q: 如何將桌面布景圖轉換成 GRUB menu 可用的 Splash Image?
例如 假設我們要將桌面布景圖檔 wallpaper.png 轉換成 GRUB menu 中 可用的 Splash Image 格式檔案 splashimage.xpm.gz
convert -resize 640x480 -colors 14 wallpaper.png splashimage.xpm && gzip splashimage.xpm
Q: 如何暫時略過開機時載入的服務 (boot-up services)?
按下 'Ctrl + C'
Q: 如何永遠禁止/啟用開機時載入的服務 (boot-up services)?
sudo chmod -x /etc/init.d/service_name
sudo chmod +x /etc/init.d/service_name
sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup sudo gedit /etc/init.d/sysklogd
... stop) log_begin_msg "Stopping system log daemon..." start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile log_end_msg $? ...
rm -fr /tmp/* /tmp/.??*
Q: 如何安裝 ClamAV AntiVirus 病毒防制伺服器?
sudo apt-get install clamav
sudo freshclam
sudo clamscan -r /location_of_files_or_folders
例如每天子時自動掃瞄 檔案/檔案夾 來搜尋病毒 * * * * * 分別代表 分 時 日 月 年
export EDITOR=gedit && sudo crontab -e
00 00 * * * sudo clamscan -r /location_of_files_or_folders
Q: 如何安裝 Samba 伺服器來提供 檔案/檔案夾 分享的服務?
sudo apt-get install samba sudo apt-get install smbfs
smbpasswd -a system_username sudo gedit /etc/samba/smbusers
system_username = "network username"
sudo smbpasswd -a system_username
sudo smbpasswd -x system_username
Q: 如何分享家目錄 (home folders) 並只有讀取的權限 (Authentication=Yes - 權限認證開啟)?
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... ; security = user ...
security = user username map = /etc/samba/smbusers
sudo testparm sudo /etc/init.d/samba restart
Q: 如何分享家目錄 (home folders)並有讀取和寫入的權限 (Authentication=Yes - 權限認證開啟)?
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... ; security = user ...
security = user username map = /etc/samba/smbusers
... # By default, the home directories are exported read -only. Change next # parameter to 'yes' if you want to be able to write to them. writable = no ...
# By default, the home directories are exported read -only. Change next # parameter to 'yes' if you want to be able to write to them. writable = yes
sudo testparm sudo /etc/init.d/samba restart
Q: 如何分享群組檔案夾 (group folders) 並只有讀取的權限 (Authentication=Yes - 權限認證開啟)?
sudo mkdir /home/group sudo chmod 777 /home/group/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... ; security = user ...
security = user username map = /etc/samba/smbusers
[Group] comment = Group Folder path = /home/group public = yes writable = no valid users = system_username1 system_username2 create mask = 0700 directory mask = 0700 force user = nobody force group = nogroup
sudo testparm sudo /etc/init.d/samba restart
Q: 如何分享群組檔案夾 (group folders)並有讀取和寫入的權限 (Authentication=Yes - 權限認證開啟)?
sudo mkdir /home/group sudo chmod 777 /home/group/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... ; security = user ...
security = user username map = /etc/samba/smbusers
[Group] comment = Group Folder path = /home/group public = yes writable = yes valid users = system_username1 system_username2 create mask = 0700 directory mask = 0700 force user = nobody force group = nogroup
sudo testparm sudo /etc/init.d/samba restart
Q: 如何開啟公用檔案夾的分享功能並只有讀取的權限 (Authentication=Yes - 權限認證開啟)?
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... ; security = user ...
security = user username map = /etc/samba/smbusers
[public] comment = Public Folder path = /home/public public = yes writable = no create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
sudo testparm sudo /etc/init.d/samba restart
Q: 如何開啟公用檔案夾的分享功能並有讀取和寫入的權限 (Authentication=Yes - 權限認證開啟)?
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... ; security = user ...
security = user username map = /etc/samba/smbusers
[public] comment = Public Folder path = /home/public public = yes writable = yes create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
sudo testparm sudo /etc/init.d/samba restart
Q: 如何開啟公用檔案夾的分享功能並只有讀取的權限 (Authentication=No - 權限認證關閉)?
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... ; security = user ...
security = share
[public] comment = Public Folder path = /home/public public = yes writable = no create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
sudo testparm sudo /etc/init.d/samba restart
Q: 如何開啟公用檔案夾的分享功能並有讀取和寫入的權限 (Authentication=No - 權限認證關閉)?
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo gedit /etc/samba/smb.conf
... ; security = user ...
security = share
[public] comment = Public Folder path = /home/public public = yes writable = yes create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
sudo testparm sudo /etc/init.d/samba restart
sudo apt-get install ssh
例如 假設遠端的 Ubuntu 主機已經安裝了 SSH 伺服器服務 請參閱 如何安裝 SSH 伺服器來遠端遙控管理系統? 遠端 Ubuntu 主機 : 192.168.0.1
ssh username@192.168.0.1
Q: 如何從遠端的 Ubuntu 主機複製檔案/檔案夾到本地的主機內 (scp)?
例如 假設遠端的 Ubuntu 主機已經安裝了 SSH 伺服器服務 請參閱 如何安裝 SSH 伺服器來遠端遙控管理系統? 遠端 Ubuntu 主機 : 192.168.0.1 遠端要複製的 檔案/檔案夾 位置 : /home/username/remotefile.txt 本地主機要儲存的位置 : . (目前工作目錄)
scp -r username@192.168.0.1:/home/username/remotefile.txt .
Q: 如何從本地主機複製檔案/檔案夾到遠端的 Ubuntu 主機內 (scp)?
例如 假設遠端的 Ubuntu 主機已經安裝了 SSH 伺服器服務 請參閱 如何安裝 SSH 伺服器來遠端遙控管理系統? 本地主機 檔案/檔案夾 的位置 : localfile.txt 遠端 Ubuntu 主機 : 192.168.0.1 遠端 Ubuntu 主機上要存放的位置 : /home/username/
scp -r localfile.txt username@192.168.0.1:/home/username/
Q: 如何從遠端 Ubuntu 主機上複製 檔案/檔案夾 到本地主機上 (rsync)?
例如 假設遠端的 Ubuntu 主機已經安裝了 SSH 伺服器服務 請參閱 如何安裝 SSH 伺服器來遠端遙控管理系統? 遠端 Ubuntu 主機 : 192.168.0.1 遠端要複製的 檔案/檔案夾 位置 : /home/username/remotefile.txt 本地主機要儲存的位置 : . (目前工作目錄)
rsync -v -u -a --delete --rsh=ssh --stats username@192.168.0.1:/home/username/remotefile.txt .
Q: 如何從本地主機複製 檔案/檔案夾 到遠端的 Ubuntu 主機內 (rsync)?
例如 假設遠端的 Ubuntu 主機已經安裝了 SSH 伺服器服務 請參閱 如何安裝 SSH 伺服器來遠端遙控管理系統? 本地主機 檔案/檔案夾 的位置 : localfile.txt 遠端 Ubuntu 主機 : 192.168.0.1 遠端 Ubuntu 主機上要存放的位置 : /home/username/
rsync -v -u -a --delete --rsh=ssh --stats localfile.txt username@192.168.0.1:/home/username/
Q: 如何從 Windows 主機來 SSH 連線到遠端的 Ubuntu 主機?
例如 假設遠端的 Ubuntu 主機已經安裝了 SSH 伺服器服務 請參閱 如何安裝 SSH 伺服器來遠端遙控管理系統?
Q: 如何從 Windows 主機複製 檔案/檔案夾 從/到 遠端的 Ubuntu 主機內?
例如 假設遠端的 Ubuntu 主機已經安裝了 SSH 伺服器服務 請參閱 如何安裝 SSH 伺服器來遠端遙控管理系統?
例如 假設 "eth0" 是我們的網路卡的介面 IP Address Range: 192.168.0.100 to 192.168.0.200 Subnet Mask: 255.255.255.0 DNS Servers: 202.188.0.133, 202.188.1.5 Domains: tm.net.my Gateway Address: 192.168.0.1
sudo apt-get install dhcp3-server sudo cp /etc/default/dhcp3-server /etc/default/dhcp3-server_backup sudo gedit /etc/default/dhcp3-server
... INTERFACES=""
INTERFACES="eth0"
sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_backup sudo gedit /etc/dhcp3/dhcpd.conf
... # option definitions common to all supported networks... option domain-name "example.org"; option domain-name-servers ns1.example.org, ns2.example.org; default-lease-time 600; max-lease-time 7200; ...
# option definitions common to all supported networks... #option domain-name "example.org"; #option domain-name-servers ns1.example.org, ns2.example.org; #default-lease-time 600; #max-lease-time 7200;
... # A slightly different configuration for an internal subnet. #subnet 10.5.5.0 netmask 255.255.255.224 { # range 10.5.5.26 10.5.5.30; # option domain-name-servers ns1.internal.example.org; # option domain-name "internal.example.org"; # option routers 10.5.5.1; # option broadcast-address 10.5.5.31; # default-lease-time 600; # max-lease-time 7200; #} ...
# A slightly different configuration for an internal subnet. subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.100 192.168.0.200; option domain-name-servers 202.188.0.133, 202.188.1.5; option domain-name "tm.net.my"; option routers 192.168.0.1; option broadcast-address 192.168.0.255; default-lease-time 600; max-lease-time 7200; }
sudo /etc/init.d/dhcp3-server restart
sudo apt-get install mysql-server mysqladmin -u root password db_user_password
sudo apt-get install mysqlcc sudo gedit /usr/share/applications/MySQLCC.desktop
[Desktop Entry] Name=MySQLCC Comment=MySQLCC Exec=mysqlcc Icon=/usr/share/pixmaps/mysqlcc.xpm Terminal=false Type=Application Categories=Application;System;
Q: 如何安裝 Apache HTTP 伺服器作為 HTTP (Web) 伺服器服務?
sudo apt-get install apache2
Q: 如何安裝搭配 Apache HTTP 伺服器使用的 PHP?
sudo apt-get install php4 sudo gedit /var/www/testphp.php
<?php phpinfo(); ?>
Q: 如何安裝搭配 Apache HTTP 伺服器使用的 MYSQL?
sudo apt-get install libapache2-mod-auth-mysql sudo apt-get install php4-mysql sudo /etc/init.d/apache2 restart
Q: 如何映設 URLs 到 /var/www/ 以外的檔案夾?
sudo gedit /etc/apache2/conf.d/alias
Alias /URL-path /location_of_folder/ <Directory /location_of_folder/> Order allow,deny Allow from all </Directory>
sudo /etc/init.d/apache2 restart
例如 假設新的埠號為 79
sudo cp /etc/apache2/ports.conf /etc/apache2/ports.conf_backup sudo gedit /etc/apache2/ports.conf
Listen 80
Listen 79
sudo /etc/init.d/apache2 restart
Q: 如何使用 Mozilla Firefox 瀏覽被更改過埠號的 Apache HTTP 伺服器?
例如 假設新的埠號為 79
sudo cp /usr/lib/mozilla-firefox/greprefs/all.js /usr/lib/mozilla-firefox/greprefs/all.js_backup sudo gedit /usr/lib/mozilla-firefox/greprefs/all.js
... // If there is ever a security firedrill that requires // us to block certian ports global, this is the pref // to use. Is is a comma delimited list of port numbers // for example: // pref("network.security.ports.banned", "1,2,3,4,5"); // prevents necko connecting to ports 1-5 unless the protocol // overrides. ...
pref("network.security.ports.banned.override", "79");
Q: 如何安裝 GNUMP3d 作為網路影音串流伺服器 (Streaming Media) 服務?
例如 /var/music/ 是存放影音檔案的目錄
sudo apt-get install gnump3d
例如 假設存放影音檔案的新目錄為 /home/music/
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup sudo gedit /etc/gnump3d/gnump3d.conf
root = /var/music
root = /home/music
user = gnump3d
user = root
sudo /etc/init.d/gnump3d restart
例如 假設新的埠號為 7979
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup sudo gedit /etc/gnump3d/gnump3d.conf
port = 8888
port = 7979
sudo /etc/init.d/gnump3d restart
Q: 與 ntp.ubuntulinux.org 進行時間同步... (載入時間太長)
service_name = ntpdate
Q: 如何禁止系統時間/日期被重新設置為 UTC (GMT)?
sudo cp /etc/default/rcS /etc/default/rcS_backup sudo gedit /etc/default/rcS
... UTC=yes ...
UTC=no
Set the correct time/date
sudo /etc/init.d/hwclock.sh restart
sudo killall esd sudo cp /etc/esound/esd.conf /etc/esound/esd.conf_backup sudo gedit /etc/esound/esd.conf
... auto_spawn=0 spawn_options=-terminate -nobeeps -as 5 ...
auto_spawn=1 spawn_options=-terminate -nobeeps -as 2 -d default
sudo apt-get install libesd-alsa0 sudo gedit /etc/asound.conf
pcm.card0 { type hw card 0 } pcm.!default { type plug slave.pcm "dmixer" } pcm.dmixer { type dmix ipc_key 1025 slave { pcm "hw:0,0" period_time 0 period_size 2048 buffer_size 32768 rate 48000 } bindings { 0 0 1 1 } }
sudo ln -fs /usr/lib/libesd.so.0 /usr/lib/libesd.so.1
General 分頁 -> Sounds for events (不勾選)
sudo rm -fr $HOME/.Trash/
rm -fr $HOME/.config/menus/applications.menu
Q: 如何在 GNOME 內更新 Place 選單的顯示 (如果無法顯示 /etc/fstab 內指定到 /media/ 的掛載)?
sudo /etc/init.d/dbus-1 restart
Q: 如何從 Hoary Hedgehog (5.04) 升級到 Breezy Badger (5.10) (試驗性)?
警告! 5.10 目前還在開發階段. Only use it for experimental purposes 升級完後, 可能會破壞您的系統的完整性
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup sudo gedit /etc/apt/sources.list
deb cdrom:[Ubuntu 5.04 _Hoary Hedgehog_ - Release i386 (20050407)]/ hoary main restricted ## Uncomment the following two lines to fetch updated software from the network # deb http://us.archive.ubuntu.com/ubuntu hoary main restricted # deb-src http://us.archive.ubuntu.com/ubuntu hoary main restricted ## Uncomment the following two lines to fetch major bug fix updates produced ## after the final release of the distribution. # deb http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted # deb-src http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted ## Uncomment the following two lines to add software from the 'universe' ## repository. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. # deb http://us.archive.ubuntu.com/ubuntu hoary universe # deb-src http://us.archive.ubuntu.com/ubuntu hoary universe # deb http://security.ubuntu.com/ubuntu hoary-security main restricted # deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted # deb http://security.ubuntu.com/ubuntu hoary-security universe # deb-src http://security.ubuntu.com/ubuntu hoary-security universe
#deb cdrom:[Ubuntu 5.04 _Hoary Hedgehog_ - Release i386 (20050407)]/ hoary main restricted ## Uncomment the following two lines to fetch updated software from the network deb http://us.archive.ubuntu.com/ubuntu breezy main restricted deb-src http://us.archive.ubuntu.com/ubuntu breezy main restricted ## Uncomment the following two lines to fetch major bug fix updates produced ## after the final release of the distribution. deb http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted ## Uncomment the following two lines to add software from the 'universe' ## repository. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. deb http://us.archive.ubuntu.com/ubuntu breezy universe deb-src http://us.archive.ubuntu.com/ubuntu breezy universe deb http://security.ubuntu.com/ubuntu breezy-security main restricted deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted deb http://security.ubuntu.com/ubuntu breezy-security universe deb-src http://security.ubuntu.com/ubuntu breezy-security universe deb http://archive.ubuntu.com/ubuntu breezy multiverse deb-src http://archive.ubuntu.com/ubuntu breezy multiverse deb ftp://ftp.nerim.net/debian-marillat stable main deb ftp://ftp.nerim.net/debian-marillat unstable main deb ftp://ftp.nerim.net/debian-marillat testing main
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 1F41B907 gpg --armor --export 1F41B907 | sudo apt-key add - sudo apt-get update sudo apt-get dist-upgrade
Ubuntu Logo, Ubuntu and Canonical are trademarks of Canonical Ltd.