Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 系統管理實戰技巧集錦:終端優化、硬碟調校、遠端管理與服務配置

編輯:Linux 教學

關閉終端機螢幕節能

終端模式下螢幕自動關閉功能雖省電,但需即時顯示網路流量、封包分析時極討厭。修改 CMOS 與系統屬性無效,解法:

setterm --blank 0

Man Page 轉純文字檔

Man 頁重導向直接存檔會產生重複字元與製表符。使用:

man tcsh | col -b > tcsh.txt

即可獲得無雜訊的純文字說明檔。

IDE 硬碟參數優化

Linux 預設側重資料安全而非效能。用 hdparm 顯示/設定硬碟參數:

hdparm -i /dev/hda        # 查看目前設定
hdparm -c1 /dev/hda       # 啟用 32-bit I/O
hdparm -m16 /dev/hda      # 啟用 MultiCount(先用 -i 確認最大值)
hdparm -t /dev/hda        # 優化前後效能測試

允許 Root 遠端登入

預設禁止 root 遠端登入。編輯 /etc/securetty,在 root 區段加入 pts/0、pts/1 等允許的終端機名稱。

恢復被覆蓋的 MBR (LILO)

先裝 Linux 再裝 Windows 導致 LILO 被覆蓋。進入 Windows 命令列,從 Linux 光碟複製 loadlin.exe、vmlinuz 至 Windows 分區,執行:

loadlin vmlinuz root=/dev/hda? rw

進入 Linux 後修改 /etc/lilo.conf 首項 boot=/dev/hda,執行 lilo 恢復。若需完整功能,可用 mkbootdisk 建立啟動盤啟動後再修復。

關鍵配置檔速查表

檔案作用
/etc/rc.d/rc.sysinit系統啟動公用服務配置
/etc/rc.d/rc.local系統啟動本地服務配置
/etc/bashrc、/etc/profilebash shell 公用配置
/home/username/.bashrc用戶私人 bash 配置
/etc/securetty終端機安全設定
/etc/hosts主機名與 IP 對應
/etc/resolv.confDNS 伺服器配置
/etc/squid.confSquid 代理配置
/etc/smb.confSMB 網上鄰居配置
/etc/dhcpd.confDHCP 伺服器配置
/etc/filesystems支援檔案系統列表
/etc/fstab已啟用分區資訊
/etc/host.confDNS 搜尋順序配置
/etc/lilo.confLILO 啟動配置

整合 Linux 至 Windows NT/2000 開機選單

安裝 LILO 至 Linux 分區,用 dd if=/dev/hda? bs=512 count=1 of=/mnt/dos/bootsect.lin 複製開機磁區,修改 boot.ini 加入 C:\BOOTSECT.LIN="紅帽子Linux7.0"。注意 NT 僅識別 8.3 格式檔名。

Squid 透明代理檔案型別過濾

acl denymine urlpath_regex .exe .zip
http_access deny denymine

配合 iptables 重導向強制走代理,完全控制用戶檔案下載。

強制彩色檔案顯示

配置檔加入:alias ls="ls --color -F -N"。

Cron 維持 NTFS 分區掛載

網路上 NTFS 分區建議每 15 分鐘用 cron 定時存取,防止長時間閒置導致掛載失敗。

Copyright © Windows教程網 All Rights Reserved