顯示具有 debian 標籤的文章。 顯示所有文章
顯示具有 debian 標籤的文章。 顯示所有文章

2009年1月12日 星期一

Install ssh server on Debian

最近想架一台server來玩 選擇了Debain做為系統
Debain的系統很乾淨 剛裝完很多東西都沒有 需要自動安裝
最常用的ssh也是 這時就需要安裝囉~~~

Debian的線上套件管理是使用 apt這隻程式
首先 先來找套件
xiang-debian:~# apt-cache search ssh
openssh-client - Secure shell client, an rlogin/rsh/rcp replacement
openssh-server - Secure shell server, an rshd replacement
上面的指令是搜尋有ssh的套件 當然 會列出很多 這裡全部省略 只要注意上面這兩個
openssh-client 就是ssh用戶端的意思,有安裝這個才可以登入別人的ssh 主機
openssh-server 就是ssh伺服器的意思,安裝完就可以讓別人使用ssh登入你的主機
系統預設會安裝client不會安裝serer,所以為了能方便之後的作業可以使用ssh來登入,現在就要安裝openssh-server這個套件

xiang-debian:~# apt-get install openssh-server
apt的優點就是會自動把相關的套件都安裝好,安裝過程只要確認一下就好了

之後再到 /etc/init.d下執行
./ssh start 讓他跑起來後就能用ssh登入了

2008年1月9日 星期三

apt

APT(Advanced Package Tool)是 Debian GNU/Linux 用來管理套件的工具

apt功能
apt 能安裝 管理 移除 或是升級套件,而且最重要的 他會自動解決相依性的問題
假如在安裝A套件時 需要先安裝B套件,在以前我們會需要先去下載並安裝B套件,之後在安裝A套件,但是apt會"自動"的執行

apt運作原理
事實上apt是透過網路連線連到遠端的伺服器上去下載套件的,在 /etc/apt/sources.list 這個檔案裡設定我們指定的apt 伺服器位址.

sources.list 格式
deb uri distribution [component1] [componenent2] [...]
deb 這一欄只有兩種寫法 deb . deb-src , deb為編譯好的套件, deb-src 則為 source 的版本

uri ( Universal Resource Identifier ) 套件的來源位置, 位置可以是系統的某個file CDROM 的檔案 遠端伺服器(http ftp)的檔案等等
常見選項 file 系統內的檔案 deb file:/home/moto/debian stable main contrib non-free
CDROM 光碟檔案 deb cdrom:/dists stable main contrib non-free
http 透過http傳輸 deb http://http.us.debian.org/debian stable main contrib non-free
distribution debian 軟體種類(下面說明)

component 參數共分為 『 main 』、『 contrib 』、『 non-US 』、『 non-free 』
main 最基本及主要且符合自由軟體規範的軟體
contrib 這裡頭軟體雖然可以在 Debian 裡頭運作,即使本身屬於自由軟體但多半卻是相依於非自由 ( non-free ) 軟體。
non-US 來自非美國地區的軟體
non-free 非屬於自由軟體

關於debian 的軟體種類大致上分為三種 stable . testing . unstable
stable
最穩定的版本,通常適合用在伺服器上面

testing
已經相當接近stable的版本,這些軟體大多是從unstable流入, 適合desktop使用

unstable
版本最新的類型,不過通常太新相對的bug也比較多一點,但更新速度很快就是了

參考資料 debian 無痛起步

debian 套件管理

debian 最基本的套件管理工具是 dpkg 操作對象為檔案名稱
另一個工具是 apt 操作對象為套件名稱

dpkg
語法 dpkg [option] action
dpkg會維護 /var/lib/dpkg 目錄下的套件資訊
其中 available 列出所有可用套件
status 紀錄套件的屬性
選項
-i 接套件名稱 安裝指定的套件
-l 接pattern 在以安裝的套建中 列出指定的 pattern 以及相關資料
-L 接套件名稱 列出安裝該套件所會安裝的檔案
-r 接套件名稱 移除該套件 但保留組態檔
--purge 接套件名稱 移除該套件的所有檔案
--info 接套件名稱 套件相關資訊
其他的 請找man吧

使用 --info 的範例
==============================================
xiang-debian:/tmp# dpkg --info lynx_2.8.5-2sarge2.2_i386.deb
新格式的 debian 套件,版本是 2.0。
大小 1859352 bytes:主控檔案=1200 bytes。
14 字節, 1 行 conffiles
854 字節, 20 行 control
468 字節, 20 行 * postinst #!/bin/sh
228 字節, 15 行 * postrm #!/bin/sh
537 字節, 15 行 * preinst #!/bin/sh
206 字節, 9 行 * prerm #!/bin/sh
Package: lynx
Version: 2.8.5-2sarge2.2
Section: web
Priority: optional
Architecture: i386
Depends: libbz2-1.0, libc6 (>= 2.3.6-6), libgnutls13 (>= 1.4.0-0), libncursesw5 (>= 5.4-5), zlib1g (>= 1:1.2.1)
Recommends: mime-support
Conflicts: lynx-ssl
Replaces: lynx-ssl
Provides: www-browser, news-reader, lynx-ssl
Installed-Size: 4568
Maintainer: James Troup
Description: Text-mode WWW Browser
Lynx is a fully-featured World Wide Web (WWW) client for users
running cursor-addressable, character-cell display devices (e.g.,
vt100 terminals, vt100 emulators running on PCs or Macs, or any other
"curses-oriented" display). It will display hypertext markup language
(HTML) documents containing links to files residing on the local
system, as well as files residing on remote systems running Gopher,
HTTP, FTP, WAIS, and NNTP servers.
===============================================

debian 學習

最近參加了debian的讀書會 所以會開始記些debian的東西囉


/xiang