以往帽客都是去cat /etc/issue這個檔案來查看是那個Linux的版本,但事實上這個檔案是可被修改的。今天找到了一個能100%確認是那一套Linux distribution的指令了,lsb_release,以下列出了cat /etc/issue與lsb_release去確認Linux distribution的結果:
1. cat /etc/issue
[root@server2 tmp]# cat /etc/issue
CentOS release 5 (Final)
Kernel \r on an \m
2. lsb_release
[root@server2 tmp]# lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5 (Final)
Release: 5
Codename: Final
Thursday, March 27, 2008
Tuesday, March 18, 2008
selinux on RHEL5.1
今天在RHEL5.1中,將selinux enable起來,在此分享一下心得:
1. Enable selinux:
[root@dns html]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
-> 將SELINUX=disabled改成SELINUX=enforcing,並重新開機。
2.查看目前selinux的狀態:
[root@dns html]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
如果要查詢到更多的資訊,可加上 -v參數:
[root@dns html]# sestatus -v
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
Process contexts:
Current context: root:system_r:unconfined_t:SystemLow-SystemHigh
Init context: system_u:system_r:init_t
/sbin/mingetty system_u:system_r:getty_t
/usr/sbin/sshd system_u:system_r:unconfined_t:SystemLow-SystemHigh
File contexts:
Controlling term: root:object_r:devpts_t
/etc/passwd system_u:object_r:etc_t
/etc/shadow system_u:object_r:shadow_t
/bin/bash system_u:object_r:shell_exec_t
/bin/login system_u:object_r:login_exec_t
/bin/sh system_u:object_r:bin_t -> system_u:object_r:shell_exec_t
/sbin/agetty system_u:object_r:getty_exec_t
/sbin/init system_u:object_r:init_exec_t
/sbin/mingetty system_u:object_r:getty_exec_t
/usr/sbin/sshd system_u:object_r:sshd_exec_t
/lib/libc.so.6 system_u:object_r:lib_t -> system_u:object_r:lib_t
/lib/ld-linux.so.2 system_u:object_r:lib_t -> system_u:object_r:ld_so_t
3.查看selinux對daemon的booleans,以查尋httpd為例:
[root@dns html]# getsebool -a | grep httpd
allow_httpd_anon_write --> off
allow_httpd_mod_auth_pam --> off
allow_httpd_sys_script_anon_write --> off
httpd_builtin_scripting --> on
httpd_can_network_connect --> off
httpd_can_network_connect_db --> off
httpd_can_network_relay --> off
httpd_disable_trans --> off
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> on
httpd_rotatelogs_disable_trans --> off
httpd_ssi_exec --> off
httpd_suexec_disable_trans --> off
httpd_tty_comm --> off
httpd_unified --> on
如果要設定booleans,可利用setsebool,比如說當我不想要selinux控管httpd時,可以這樣做:
[root@dns html]# setsebool -P httpd_disable_trans 1
[root@dns html]# getsebool -a | grep httpd_disable_trans
httpd_disable_trans --> on
其中0代表off,1代表on,而-P的參數是代表下次開機時套用新的boolean值。
現在來個狀況練習一下,在selinux enable的狀況下,允許匿名的ftp account可以get與put file,並且可以overwrite。
1. 設定vsftpd(請參考以下的configure):
[root@dns html]# cat /etc/vsftpd/vsftpd.conf | grep -v "^$" | grep -v "^#"
anonymous_enable=YES
anon_other_write_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
在以往沒有開啟selinux時,已經達成了題目需求,但當selinux開啟時,是會踢到鐵板的,看一下以下的示範吧:
chiu-lawrencede-ibook-g4:~ Lawrence$ ftp 10.5.30.147
Connected to 10.5.30.147.
220 (vsFTPd 2.0.5)
Name (10.5.30.147:Lawrence): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub
250 Directory successfully changed.
ftp> put backup.sh
local: backup.sh remote: backup.sh
229 Entering Extended Passive Mode (|||50891|)
553 Could not create file.
ftp>
查看一下ftp的booleans:
[root@dns pub]# getsebool -a | grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> off
ftpd_disable_trans --> off
ftpd_is_daemon --> on
httpd_enable_ftp_server --> off
tftpd_disable_trans --> off
看到了嗎?allow_ftpd_anon_write --> off與allow_ftpd_full_access --> off,來enable它們吧!
[root@dns pub]# setsebool -P allow_ftpd_anon_write 1
[root@dns pub]# setsebool -P allow_ftpd_full_access 1
再試一次put檔案:
chiu-lawrencede-ibook-g4:~ Lawrence$ ftp 10.5.30.147
Connected to 10.5.30.147.
220 (vsFTPd 2.0.5)
Name (10.5.30.147:Lawrence): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub
250 Directory successfully changed.
ftp> put backup.sh
local: backup.sh remote: backup.sh
229 Entering Extended Passive Mode (|||50580|)
150 Ok to send data.
100% |***********************************************************************************| 666 1.92 MB/s 00:00
226 File receive OK.
666 bytes sent in 00:00 (1.62 KB/s)
ftp> put backup.sh
local: backup.sh remote: backup.sh
229 Entering Extended Passive Mode (|||37711|)
150 Ok to send data.
100% |***********************************************************************************| 666 2.76 MB/s 00:00
226 File receive OK.
666 bytes sent in 00:00 (2.92 KB/s)
ftp>
完成。
1. Enable selinux:
[root@dns html]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
-> 將SELINUX=disabled改成SELINUX=enforcing,並重新開機。
2.查看目前selinux的狀態:
[root@dns html]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
如果要查詢到更多的資訊,可加上 -v參數:
[root@dns html]# sestatus -v
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
Process contexts:
Current context: root:system_r:unconfined_t:SystemLow-SystemHigh
Init context: system_u:system_r:init_t
/sbin/mingetty system_u:system_r:getty_t
/usr/sbin/sshd system_u:system_r:unconfined_t:SystemLow-SystemHigh
File contexts:
Controlling term: root:object_r:devpts_t
/etc/passwd system_u:object_r:etc_t
/etc/shadow system_u:object_r:shadow_t
/bin/bash system_u:object_r:shell_exec_t
/bin/login system_u:object_r:login_exec_t
/bin/sh system_u:object_r:bin_t -> system_u:object_r:shell_exec_t
/sbin/agetty system_u:object_r:getty_exec_t
/sbin/init system_u:object_r:init_exec_t
/sbin/mingetty system_u:object_r:getty_exec_t
/usr/sbin/sshd system_u:object_r:sshd_exec_t
/lib/libc.so.6 system_u:object_r:lib_t -> system_u:object_r:lib_t
/lib/ld-linux.so.2 system_u:object_r:lib_t -> system_u:object_r:ld_so_t
3.查看selinux對daemon的booleans,以查尋httpd為例:
[root@dns html]# getsebool -a | grep httpd
allow_httpd_anon_write --> off
allow_httpd_mod_auth_pam --> off
allow_httpd_sys_script_anon_write --> off
httpd_builtin_scripting --> on
httpd_can_network_connect --> off
httpd_can_network_connect_db --> off
httpd_can_network_relay --> off
httpd_disable_trans --> off
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> on
httpd_rotatelogs_disable_trans --> off
httpd_ssi_exec --> off
httpd_suexec_disable_trans --> off
httpd_tty_comm --> off
httpd_unified --> on
如果要設定booleans,可利用setsebool,比如說當我不想要selinux控管httpd時,可以這樣做:
[root@dns html]# setsebool -P httpd_disable_trans 1
[root@dns html]# getsebool -a | grep httpd_disable_trans
httpd_disable_trans --> on
其中0代表off,1代表on,而-P的參數是代表下次開機時套用新的boolean值。
現在來個狀況練習一下,在selinux enable的狀況下,允許匿名的ftp account可以get與put file,並且可以overwrite。
1. 設定vsftpd(請參考以下的configure):
[root@dns html]# cat /etc/vsftpd/vsftpd.conf | grep -v "^$" | grep -v "^#"
anonymous_enable=YES
anon_other_write_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
在以往沒有開啟selinux時,已經達成了題目需求,但當selinux開啟時,是會踢到鐵板的,看一下以下的示範吧:
chiu-lawrencede-ibook-g4:~ Lawrence$ ftp 10.5.30.147
Connected to 10.5.30.147.
220 (vsFTPd 2.0.5)
Name (10.5.30.147:Lawrence): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub
250 Directory successfully changed.
ftp> put backup.sh
local: backup.sh remote: backup.sh
229 Entering Extended Passive Mode (|||50891|)
553 Could not create file.
ftp>
查看一下ftp的booleans:
[root@dns pub]# getsebool -a | grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> off
ftpd_disable_trans --> off
ftpd_is_daemon --> on
httpd_enable_ftp_server --> off
tftpd_disable_trans --> off
看到了嗎?allow_ftpd_anon_write --> off與allow_ftpd_full_access --> off,來enable它們吧!
[root@dns pub]# setsebool -P allow_ftpd_anon_write 1
[root@dns pub]# setsebool -P allow_ftpd_full_access 1
再試一次put檔案:
chiu-lawrencede-ibook-g4:~ Lawrence$ ftp 10.5.30.147
Connected to 10.5.30.147.
220 (vsFTPd 2.0.5)
Name (10.5.30.147:Lawrence): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub
250 Directory successfully changed.
ftp> put backup.sh
local: backup.sh remote: backup.sh
229 Entering Extended Passive Mode (|||50580|)
150 Ok to send data.
100% |***********************************************************************************| 666 1.92 MB/s 00:00
226 File receive OK.
666 bytes sent in 00:00 (1.62 KB/s)
ftp> put backup.sh
local: backup.sh remote: backup.sh
229 Entering Extended Passive Mode (|||37711|)
150 Ok to send data.
100% |***********************************************************************************| 666 2.76 MB/s 00:00
226 File receive OK.
666 bytes sent in 00:00 (2.92 KB/s)
ftp>
完成。
Friday, March 14, 2008
Thursday, March 13, 2008
RHEL5 群組管理員
這是以前沒有的觀念,故在此做個筆記:
Objective: 讓一般user可以控管(新增/刪除)群組的成員
Environment:
law -> g1 group的群組管理員
g1 -> 測試用的group
alex -> 將被law assign到g1 group
/home/g1 -> g1 group的共用目錄,權限為770
Setup1. 將law設定為g1群組管理員:
[root@server3 home]# gpasswd -A law g1
[root@server3 home]# grep law /etc/gshadow
law:!::
g1:!:law:
(可在/etc/gshadow中,每個群組的第三個欄位查詢群組管理員
Setup2. 將alex加讓到g1 group:
[law@server3 ~]$ id alex
uid=502(alex) gid=503(alex) groups=503(alex)
[law@server3 ~]$ gpasswd -a alex g1
Adding user alex to group g1
[law@server3 ~]$ id alex
uid=502(alex) gid=503(alex) groups=503(alex),502(g1)
Setup3. 驗證一下alex可至/home/g1 建立檔案:
[alex@server3 home]$ ls -dl /home/g1/
drwxrwx--- 2 root g1 4096 Oct 21 05:06 /home/g1/
[alex@server3 home]$ cd g1
[alex@server3 g1]$ touch alex
[alex@server3 g1]$ ls -l alex
-rw-rw-r-- 1 alex alex 0 Oct 21 05:13 alex
Objective: 讓一般user可以控管(新增/刪除)群組的成員
Environment:
law -> g1 group的群組管理員
g1 -> 測試用的group
alex -> 將被law assign到g1 group
/home/g1 -> g1 group的共用目錄,權限為770
Setup1. 將law設定為g1群組管理員:
[root@server3 home]# gpasswd -A law g1
[root@server3 home]# grep law /etc/gshadow
law:!::
g1:!:law:
(可在/etc/gshadow中,每個群組的第三個欄位查詢群組管理員
Setup2. 將alex加讓到g1 group:
[law@server3 ~]$ id alex
uid=502(alex) gid=503(alex) groups=503(alex)
[law@server3 ~]$ gpasswd -a alex g1
Adding user alex to group g1
[law@server3 ~]$ id alex
uid=502(alex) gid=503(alex) groups=503(alex),502(g1)
Setup3. 驗證一下alex可至/home/g1 建立檔案:
[alex@server3 home]$ ls -dl /home/g1/
drwxrwx--- 2 root g1 4096 Oct 21 05:06 /home/g1/
[alex@server3 home]$ cd g1
[alex@server3 g1]$ touch alex
[alex@server3 g1]$ ls -l alex
-rw-rw-r-- 1 alex alex 0 Oct 21 05:13 alex
Friday, March 07, 2008
RHEL5 系統管理寶典 基礎篇
最近獲贈永昇兄(Cd Chen)的近期新作"RHEL5 系統管理寶典 基礎篇",在此非常感謝永昇兄,這本新書算是永昇兄對於Redhat Linux系統管理介紹的第二版,因為撰寫第一版時有些原因,故以Fedora來介紹,難免有些遺憾,如今這本新作完全是以RHEL5來介紹,內容與前版相比也更新了許多,是非常值得有心學習Linux系統管理的讀者可參考的一本書物,如果有上過RHCE培訓課程的學生,這本書就等於是RH133的中文參考書,帽客當然不是在打廣告,而是好東西一定要推薦給大家知道,帽客這幾天也開始拜讀這本書了,雖然大部份的知識都知道,但真正的了解應該是: 懂->很懂->精通->分享&教導,所以帽客每次看不同的Linux書物時,都會有不同的收穫。
Friday, February 15, 2008
Linux存取Windows網芳
今天使用Linux machine去mount Windows網芳所分享出來的目錄時,發生了以下的錯誤:
# smbclient //X.X.X.X/temp -U lawrence
Password:
session setup failed: NT_STATUS_LOGON_FAILURE
怪了,帳號跟密碼都正確呀!看看能不能瀏覽,於是乎執行以下的command:
[root@server2 ~]# smbclient -L //X.X.X.X -N
Anonymous login successful
Domain=[XXXXX] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
Sharename Type Comment
--------- ---- -------
cli_rpc_pipe_open: cli_nt_create failed on pipe \srvsvc to machine X.X.X.X. Error was NT_STATUS_ACCESS_DENIED
Error returning browse list: NT_STATUS_ACCESS_DENIED
session request to X.X.X.X failed (Called name not present)
session request to 10 failed (Called name not present)
Anonymous login successful
Domain=[XXXXX] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
想了一下,會不會是Windows domain的問題,所以查了一下smbclient的man page,找到了以下的提示:
-W|--workgroup=domain
Set the SMB domain of the username. This overrides the default domain which is the domain defined in smb.conf. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM).
恩,在執行一次看看,這次加入了--workgroup的參數:
[root@server2 ~]# smbclient //X.X.X.X/temp -U lawrence --workgroup=XXXXX
Password:
Domain=[XXXXX] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
smb: \>
成功了!
# smbclient //X.X.X.X/temp -U lawrence
Password:
session setup failed: NT_STATUS_LOGON_FAILURE
怪了,帳號跟密碼都正確呀!看看能不能瀏覽,於是乎執行以下的command:
[root@server2 ~]# smbclient -L //X.X.X.X -N
Anonymous login successful
Domain=[XXXXX] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
Sharename Type Comment
--------- ---- -------
cli_rpc_pipe_open: cli_nt_create failed on pipe \srvsvc to machine X.X.X.X. Error was NT_STATUS_ACCESS_DENIED
Error returning browse list: NT_STATUS_ACCESS_DENIED
session request to X.X.X.X failed (Called name not present)
session request to 10 failed (Called name not present)
Anonymous login successful
Domain=[XXXXX] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
想了一下,會不會是Windows domain的問題,所以查了一下smbclient的man page,找到了以下的提示:
-W|--workgroup=domain
Set the SMB domain of the username. This overrides the default domain which is the domain defined in smb.conf. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM).
恩,在執行一次看看,這次加入了--workgroup的參數:
[root@server2 ~]# smbclient //X.X.X.X/temp -U lawrence --workgroup=XXXXX
Password:
Domain=[XXXXX] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
smb: \>
成功了!
Monday, January 28, 2008
X window重點條列
最近加強了關於X window的觀念,整理出重點如下:
- 目前的X window是由X11R6延伸發展而來
- 兩大分支: Xfree86, xorg
- X window = X Server + X Client + window manager (twm, KDE, GNOME and etcs)
- X Server: 負責將X Client的運算結果顯示於screen
- X Client: 負責處理X Server傳回的資訊,並回傳給X Server,不care X Server是用那張顯卡,那個作業系統
- Check X version: 以root身份執行 X -version
- X Server 主要設定檔, 適用於xfree86 & xorg:
/etc/X11/xorg.conf, /etc/X11/XF86Config
主要參數說明:
InputDevice -> 設定輸出入裝置: 如鍵盤 or 滑鼠
Device -> 設定顯卡為那張?驅動程式為?
Screen ->設定色度與解析度
Files -> 設定X font, 設定的方法有直接指定路徑 or 透過xfs (X font Server)
Monitor -> 設定screen的水平與垂直度頻率
Module -> 載入相關的模組
ServerLayout -> 以上所有參數都可有許多筆,至於用到那一筆則是在這邊決定
- 在runlevel 3啟動X的流程:
startx->xinit-> ~/.xinitrc -> /etc/X11/xinit/xinitrc -> ~/.xserverrc -> /etc/X11/xinit/xserverrc
- 如果是runlevel5的話,可以在/etc/inittab看到啟動display manager:
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
- 設定window manager的設定檔:
/etc/sysconfig/desktop
KDE -> startkde
GNOME -> gnome-session
-X v7.x的字型目錄:
/usr/share/fonts/
/usr/share/X11/fonts
-X v6.x的字型目錄:
/usr/X11R6/lib/X11/fonts/
-X預設在tty7,也就是ALT+CTRL+F7,執行的程式方法是 X :0,預設port是TCP 6000,如果是X :1,那麼就是tty8,i.e. ALT+CTRL+F8,TCP port 6001
-如果是用xfs管理字型的話,請確認執行X時,要先啟動xfs,否則將無法啟動X
- 目前的X window是由X11R6延伸發展而來
- 兩大分支: Xfree86, xorg
- X window = X Server + X Client + window manager (twm, KDE, GNOME and etcs)
- X Server: 負責將X Client的運算結果顯示於screen
- X Client: 負責處理X Server傳回的資訊,並回傳給X Server,不care X Server是用那張顯卡,那個作業系統
- Check X version: 以root身份執行 X -version
- X Server 主要設定檔, 適用於xfree86 & xorg:
/etc/X11/xorg.conf, /etc/X11/XF86Config
主要參數說明:
InputDevice -> 設定輸出入裝置: 如鍵盤 or 滑鼠
Device -> 設定顯卡為那張?驅動程式為?
Screen ->設定色度與解析度
Files -> 設定X font, 設定的方法有直接指定路徑 or 透過xfs (X font Server)
Monitor -> 設定screen的水平與垂直度頻率
Module -> 載入相關的模組
ServerLayout -> 以上所有參數都可有許多筆,至於用到那一筆則是在這邊決定
- 在runlevel 3啟動X的流程:
startx->xinit-> ~/.xinitrc -> /etc/X11/xinit/xinitrc -> ~/.xserverrc -> /etc/X11/xinit/xserverrc
- 如果是runlevel5的話,可以在/etc/inittab看到啟動display manager:
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
- 設定window manager的設定檔:
/etc/sysconfig/desktop
KDE -> startkde
GNOME -> gnome-session
-X v7.x的字型目錄:
/usr/share/fonts/
/usr/share/X11/fonts
-X v6.x的字型目錄:
/usr/X11R6/lib/X11/fonts/
-X預設在tty7,也就是ALT+CTRL+F7,執行的程式方法是 X :0,預設port是TCP 6000,如果是X :1,那麼就是tty8,i.e. ALT+CTRL+F8,TCP port 6001
-如果是用xfs管理字型的話,請確認執行X時,要先啟動xfs,否則將無法啟動X
Thursday, January 17, 2008
MacBook Air
Apple終於announce輕機種的NB了,重量僅1.36kg,這才是我想要的!
且觸碰板還支援多點觸碰!真是創意無限!
更詳細的spec: MacBook Air Specs
Demo影片: MackBook Air Guided
且觸碰板還支援多點觸碰!真是創意無限!
更詳細的spec: MacBook Air Specs
Demo影片: MackBook Air Guided
Tuesday, December 25, 2007
DNS: forward Zone
這算是一個蠻特別的需求,只有針對特定的domain時,才會將DNS query轉送到特定的DNS Server,不過似乎挺多單位常有這樣的需求,所以還是趕緊給它記下來吧:
zone "test.com"
{
type forward;
forwarders { 192.168.0.254; 192.168.0.253; };
};
就是這麼簡單囉,凡是看到test.com的DNS查詢時便forward到192.168.0.254與192.168.0.253這兩台DNS Server。
zone "test.com"
{
type forward;
forwarders { 192.168.0.254; 192.168.0.253; };
};
就是這麼簡單囉,凡是看到test.com的DNS查詢時便forward到192.168.0.254與192.168.0.253這兩台DNS Server。
Fix NFS ports
NFS Server有一個特性,那就是除了portmapper與nfs分別是使用固定的port number外(portmapper:111,nfs:2049),其它的port都是隨機產生的,如下所示:
[root@server3 ~]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 745 rquotad
100011 2 udp 745 rquotad
100011 1 tcp 748 rquotad
100011 2 tcp 748 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 udp 1028 nlockmgr
100021 3 udp 1028 nlockmgr
100021 4 udp 1028 nlockmgr
100021 1 tcp 3767 nlockmgr
100021 3 tcp 3767 nlockmgr
100021 4 tcp 3767 nlockmgr
100005 1 udp 760 mountd
100005 1 tcp 763 mountd
100005 2 udp 760 mountd
100005 2 tcp 763 mountd
100005 3 udp 760 mountd
100005 3 tcp 763 mountd
100024 1 udp 832 status
100024 1 tcp 835 status
[root@server3 ~]# service nfs restart; service nfslock restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Stopping NFS locking: [ OK ]
Stopping NFS statd: [ OK ]
Starting NFS statd: [ OK ]
[root@server3 ~]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 904 rquotad
100011 2 udp 904 rquotad
100011 1 tcp 907 rquotad
100011 2 tcp 907 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 udp 1028 nlockmgr
100021 3 udp 1028 nlockmgr
100021 4 udp 1028 nlockmgr
100021 1 tcp 2229 nlockmgr
100021 3 tcp 2229 nlockmgr
100021 4 tcp 2229 nlockmgr
100005 1 udp 919 mountd
100005 1 tcp 922 mountd
100005 2 udp 919 mountd
100005 2 tcp 922 mountd
100005 3 udp 919 mountd
100005 3 tcp 922 mountd
100024 1 udp 971 status
100024 1 tcp 974 status
如果要利用iptables加以控管實在是有些困難之處,所以我們可以做的是將這些daemon指定使用固定的port number,以下的步驟將告訴你怎麼做到這一點:
Linux distro: CentOS 5.0
1. 修改/etc/sysconfig/nfs檔案中的參數如下:
RQUOTAD_PORT=9000
LOCKD_TCPPORT=9001
LOCKD_UDPPORT=9001
MOUNTD_PORT=9002
STATD_PORT=9003
2. 重啟nfs與nfslock daemon,並驗證:
[root@server3 ~]# service nfs restart; service nfslock restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Stopping NFS locking: [ OK ]
Stopping NFS statd: [ OK ]
Starting NFS statd: [ OK ]
[root@server3 ~]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 9000 rquotad
100011 2 udp 9000 rquotad
100011 1 tcp 9000 rquotad
100011 2 tcp 9000 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 udp 9001 nlockmgr
100021 3 udp 9001 nlockmgr
100021 4 udp 9001 nlockmgr
100021 1 tcp 9001 nlockmgr
100021 3 tcp 9001 nlockmgr
100021 4 tcp 9001 nlockmgr
100005 1 udp 9002 mountd
100005 1 tcp 9002 mountd
100005 2 udp 9002 mountd
100005 2 tcp 9002 mountd
100005 3 udp 9002 mountd
100005 3 tcp 9002 mountd
100024 1 udp 9003 status
100024 1 tcp 9003 status
如此便完成了固定NFS Server的port number。
[root@server3 ~]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 745 rquotad
100011 2 udp 745 rquotad
100011 1 tcp 748 rquotad
100011 2 tcp 748 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 udp 1028 nlockmgr
100021 3 udp 1028 nlockmgr
100021 4 udp 1028 nlockmgr
100021 1 tcp 3767 nlockmgr
100021 3 tcp 3767 nlockmgr
100021 4 tcp 3767 nlockmgr
100005 1 udp 760 mountd
100005 1 tcp 763 mountd
100005 2 udp 760 mountd
100005 2 tcp 763 mountd
100005 3 udp 760 mountd
100005 3 tcp 763 mountd
100024 1 udp 832 status
100024 1 tcp 835 status
[root@server3 ~]# service nfs restart; service nfslock restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Stopping NFS locking: [ OK ]
Stopping NFS statd: [ OK ]
Starting NFS statd: [ OK ]
[root@server3 ~]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 904 rquotad
100011 2 udp 904 rquotad
100011 1 tcp 907 rquotad
100011 2 tcp 907 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 udp 1028 nlockmgr
100021 3 udp 1028 nlockmgr
100021 4 udp 1028 nlockmgr
100021 1 tcp 2229 nlockmgr
100021 3 tcp 2229 nlockmgr
100021 4 tcp 2229 nlockmgr
100005 1 udp 919 mountd
100005 1 tcp 922 mountd
100005 2 udp 919 mountd
100005 2 tcp 922 mountd
100005 3 udp 919 mountd
100005 3 tcp 922 mountd
100024 1 udp 971 status
100024 1 tcp 974 status
如果要利用iptables加以控管實在是有些困難之處,所以我們可以做的是將這些daemon指定使用固定的port number,以下的步驟將告訴你怎麼做到這一點:
Linux distro: CentOS 5.0
1. 修改/etc/sysconfig/nfs檔案中的參數如下:
RQUOTAD_PORT=9000
LOCKD_TCPPORT=9001
LOCKD_UDPPORT=9001
MOUNTD_PORT=9002
STATD_PORT=9003
2. 重啟nfs與nfslock daemon,並驗證:
[root@server3 ~]# service nfs restart; service nfslock restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Stopping NFS locking: [ OK ]
Stopping NFS statd: [ OK ]
Starting NFS statd: [ OK ]
[root@server3 ~]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 9000 rquotad
100011 2 udp 9000 rquotad
100011 1 tcp 9000 rquotad
100011 2 tcp 9000 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 udp 9001 nlockmgr
100021 3 udp 9001 nlockmgr
100021 4 udp 9001 nlockmgr
100021 1 tcp 9001 nlockmgr
100021 3 tcp 9001 nlockmgr
100021 4 tcp 9001 nlockmgr
100005 1 udp 9002 mountd
100005 1 tcp 9002 mountd
100005 2 udp 9002 mountd
100005 2 tcp 9002 mountd
100005 3 udp 9002 mountd
100005 3 tcp 9002 mountd
100024 1 udp 9003 status
100024 1 tcp 9003 status
如此便完成了固定NFS Server的port number。
Thursday, December 13, 2007
Linux command: screen 應用小技巧
上一篇介紹了screen的基本用法,這一篇呢,就來分享一下screen更進階的一種實用方法。
假使您所要維護的Linux機器有好幾台,每一天都要logon進去關心一下,或是操作一番,每次都要ssh過去的確是有點麻煩,搞不好一天中還要ssh進去好幾次,不太smart。
所以用screen來偷懶吧!用screen所產生的console就算你退出了screen,還是可以保留當時的使用狀況,所以我只需要把screen叫出來用就好了。好處就是快速且又保留當時操作的情境。
假想今天的Server有2台,您每天都要進去關心一下,那麼您可以寫一個script如下:
#!/bin/bash
screen -d -m -S SRV1 -t root@srv1 ssh root@192.168.0.254
screen -d -m -S SRV2 -t root@srv2 ssh root@192.168.0.253
講解一下參數:
-d -m -> 不要去attach這個screen
-S -> 設定screen name,用screen -ls時可以查看,到時可以用screen -r叫回來,有點像這個樣子:
#screen -ls
There are screens on:
555.svr1 (Detached)
560.svr2 (Detached)
# screen -r 555
-> 這樣就會回到Server1
-t -> 設定screen的title,在screen中按下CTRL+a,w時,好方便查詢。
這樣一來呢,當我想到Server1時就執行screen -ls查一下並用screen -r 555切到Server1,夠方便吧!當然你可以讓這隻script在開機時便執行,並搭配SSH免密碼登入。
假使您所要維護的Linux機器有好幾台,每一天都要logon進去關心一下,或是操作一番,每次都要ssh過去的確是有點麻煩,搞不好一天中還要ssh進去好幾次,不太smart。
所以用screen來偷懶吧!用screen所產生的console就算你退出了screen,還是可以保留當時的使用狀況,所以我只需要把screen叫出來用就好了。好處就是快速且又保留當時操作的情境。
假想今天的Server有2台,您每天都要進去關心一下,那麼您可以寫一個script如下:
#!/bin/bash
screen -d -m -S SRV1 -t root@srv1 ssh root@192.168.0.254
screen -d -m -S SRV2 -t root@srv2 ssh root@192.168.0.253
講解一下參數:
-d -m -> 不要去attach這個screen
-S -> 設定screen name,用screen -ls時可以查看,到時可以用screen -r叫回來,有點像這個樣子:
#screen -ls
There are screens on:
555.svr1 (Detached)
560.svr2 (Detached)
# screen -r 555
-> 這樣就會回到Server1
-t -> 設定screen的title,在screen中按下CTRL+a,w時,好方便查詢。
這樣一來呢,當我想到Server1時就執行screen -ls查一下並用screen -r 555切到Server1,夠方便吧!當然你可以讓這隻script在開機時便執行,並搭配SSH免密碼登入。
Thursday, December 06, 2007
Linux command: screen
screen是可遠端登入Linux建立多重終端機的一個非常好用的指令,比如你習慣用putty透過SSH登入到遠端的Linux機器,同時想開啟多個終端機時,怎麼辦呢?這時screen就派上用場了,另一個好處是在screen下所執行的命令,即使你登出了還是會繼續執行,不需另外透過nohup,以下整理一下screen常用到的一些功能。
1. 執行screen: #screen
2. screen熱鍵:
2.1 新增screen: CTRL+a,c
2.2 切換至下個screen: CTRL+a,n
2.3 切換至前一個screen: CTRL+a,a
2.4 查看目前有幾個screen: CTRL+a,w
2.5 離開screen: CTRL+a,d
2.6 刪除screen: #exit or CTRL+a,k
3. 查看目前screen status: #screen -ls
4. 回到screen: #screen -r
1. 執行screen: #screen
2. screen熱鍵:
2.1 新增screen: CTRL+a,c
2.2 切換至下個screen: CTRL+a,n
2.3 切換至前一個screen: CTRL+a,a
2.4 查看目前有幾個screen: CTRL+a,w
2.5 離開screen: CTRL+a,d
2.6 刪除screen: #exit or CTRL+a,k
3. 查看目前screen status: #screen -ls
4. 回到screen: #screen -r
Wednesday, November 21, 2007
FUSE+SSHFS
在Linux中要去mount遠端的Server某個分享資料夾,大部份是透過NFS或是Samba的方法來實做,在此帽客提供另一種方法來做,那便是利用SSH來mount。
OS: CentOS5 kernel version: 2.6.18-8.1.14.el5
透過sshfs便可以達到這樣的需求,但由於使用sshfs之前,必需安裝FUSE module,所以請先至rpm.pbone.net抓取以下的RPM並安裝:
fuse-2.7.0-1.el5.rf.i386.rpm
fuse-devel-2.7.0-3_7.el5.i386.rpm
fuse-kmdl-2.6.18-8.1.14.el5-2.7.0-3_7.el5.i686.rpm
fuse-libs-2.7.0-3_7.el5.i386.rpm
在抓取fuse-sshfs-1.8-1.el5.rf.i386.rpm安裝完後將機器重新開機或是執行modprove fuse。
由於sshfs在mount遠端時都會要求輸入密碼,如同使用ssh一樣,所以我利用了免密碼就可登入到對方主機來做。(在此server2代表client要mount server1的root家目錄)
server2: 產生金鑰並scp到server1
[root@server2 ~]# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
97:49:77:78:b0:82:13:59:fa:0b:70:ad:cd:7d:31:f1 root@server2.example.com
[root@server2 ~]# scp .ssh/id_dsa.pub root@10.4.1.33:~/server2.key.pub
Password:
id_dsa.pub
100% 614 0.6KB/s 00:00
server1: 將server2的金鑰copy到~/.ssh/authorized_keys
server1:~/.ssh # touch authorized_keys
server1:~/.ssh # cat ../server2.key.pub > authorized_keys
server2: 使用sshfs mount server1的root家目錄至/mnt/server1
[root@server2 ~]# sshfs root@10.4.1.33:/root /mnt/server1/
[root@server2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda5 13G 3.6G 8.8G 29% /
/dev/hda1 99M 14M 80M 15% /boot
tmpfs 506M 0 506M 0% /dev/shm
/dev/hda2 4.8G 138M 4.4G 4% /home
sshfs#root@10.4.1.33:/root
1000G 0 1000G 0% /mnt/server1
完成。
OS: CentOS5 kernel version: 2.6.18-8.1.14.el5
透過sshfs便可以達到這樣的需求,但由於使用sshfs之前,必需安裝FUSE module,所以請先至rpm.pbone.net抓取以下的RPM並安裝:
fuse-2.7.0-1.el5.rf.i386.rpm
fuse-devel-2.7.0-3_7.el5.i386.rpm
fuse-kmdl-2.6.18-8.1.14.el5-2.7.0-3_7.el5.i686.rpm
fuse-libs-2.7.0-3_7.el5.i386.rpm
在抓取fuse-sshfs-1.8-1.el5.rf.i386.rpm安裝完後將機器重新開機或是執行modprove fuse。
由於sshfs在mount遠端時都會要求輸入密碼,如同使用ssh一樣,所以我利用了免密碼就可登入到對方主機來做。(在此server2代表client要mount server1的root家目錄)
server2: 產生金鑰並scp到server1
[root@server2 ~]# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
97:49:77:78:b0:82:13:59:fa:0b:70:ad:cd:7d:31:f1 root@server2.example.com
[root@server2 ~]# scp .ssh/id_dsa.pub root@10.4.1.33:~/server2.key.pub
Password:
id_dsa.pub
100% 614 0.6KB/s 00:00
server1: 將server2的金鑰copy到~/.ssh/authorized_keys
server1:~/.ssh # touch authorized_keys
server1:~/.ssh # cat ../server2.key.pub > authorized_keys
server2: 使用sshfs mount server1的root家目錄至/mnt/server1
[root@server2 ~]# sshfs root@10.4.1.33:/root /mnt/server1/
[root@server2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda5 13G 3.6G 8.8G 29% /
/dev/hda1 99M 14M 80M 15% /boot
tmpfs 506M 0 506M 0% /dev/shm
/dev/hda2 4.8G 138M 4.4G 4% /home
sshfs#root@10.4.1.33:/root
1000G 0 1000G 0% /mnt/server1
完成。
Monday, November 19, 2007
[Vsftp] Allow anonymous rewrite files
今天發現到在RHEL/SLES的vsftp中,即使我開放讓anonymous有上傳與建立目錄的權限,但當要上傳並覆蓋原本的檔案時會發生權限不足的問題,原來還要多加一個設定anon_other_write_enable=YES
在此總結允許anonymous所有權限的參數:
anonymous_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
write_enable=YES
在此總結允許anonymous所有權限的參數:
anonymous_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
write_enable=YES
Friday, November 16, 2007
[Shell Script] 執行結果變指令!
#!/bin/bash
## A=100
## ls -l
## free -m
eval "`grep "^## " $0 | sed 's/^## //'`"
echo "A=$A"
短短的幾行,卻內含許多觀念!
## A=100
## ls -l
## free -m
eval "`grep "^## " $0 | sed 's/^## //'`"
echo "A=$A"
短短的幾行,卻內含許多觀念!
Friday, November 02, 2007
Top 10 Reasons Not to Use Ubuntu
http://blog.linuxtoday.com/blog/archives/071031-103438.html
這應該是反諷MS吧,雖然我不太prefer MS ,但青菜蘿菠各有所好囉~
當我把compiz特效展現給同事看時,沒有一個不心動的,已經有人安裝Ubuntu了,不過帽客也當起了免費的技術支援。
這應該是反諷MS吧,雖然我不太prefer MS ,但青菜蘿菠各有所好囉~
當我把compiz特效展現給同事看時,沒有一個不心動的,已經有人安裝Ubuntu了,不過帽客也當起了免費的技術支援。
Thursday, November 01, 2007
DNS cache issue
一般來說,DNS cache的值是以TTL來決定,而TTL也只對於DNS Server與Server之間才有用!如果對DNS Client來說它是不會去做DNS cache的,每查詢一次就update一次RR,但帽客今天發現到了一個非常有趣的現象,當你在DNS Client透過 host / nslookup /dig 來做名稱解析時,每問一次就update一次,這不難理解,合乎常規,但當你用ping時,此時就很怪異了,你會發現!被cache住了!比如我設定 server.example.com 對映到192.168.0.254 / 253, 當你用host查尋時,會每問一次就改變一次對映的IP,但ping確沒有唷!主要的原因是被nscd這隻daemon cache住囉!
nscd daemon就是用來設定DNS Client要cache住Name Server cache查尋的結果多久,這個跟TTL值一點關係也沒有,它也可以應用在LDAP,ypserver等等,以下是它的example config file:
enable-cache passwd yes
positive-time-to-live passwd 600
negative-time-to-live passwd 20
suggested-size passwd 211
check-files passwd yes
persistent passwd yes
shared passwd yes
enable-cache group yes
positive-time-to-live group 3600
negative-time-to-live group 60
suggested-size group 211
check-files group yes
persistent group yes
shared group yes
enable-cache hosts yes
positive-time-to-live hosts 5
negative-time-to-live hosts 0
suggested-size hosts 211
check-files hosts yes
persistent hosts no
shared hosts yes
hosts -> 就是針對DNS cache用的。 :)
nscd daemon就是用來設定DNS Client要cache住Name Server cache查尋的結果多久,這個跟TTL值一點關係也沒有,它也可以應用在LDAP,ypserver等等,以下是它的example config file:
enable-cache passwd yes
positive-time-to-live passwd 600
negative-time-to-live passwd 20
suggested-size passwd 211
check-files passwd yes
persistent passwd yes
shared passwd yes
enable-cache group yes
positive-time-to-live group 3600
negative-time-to-live group 60
suggested-size group 211
check-files group yes
persistent group yes
shared group yes
enable-cache hosts yes
positive-time-to-live hosts 5
negative-time-to-live hosts 0
suggested-size hosts 211
check-files hosts yes
persistent hosts no
shared hosts yes
hosts -> 就是針對DNS cache用的。 :)
Saturday, October 27, 2007
list all PCI devices
在Linux的作業系統下,如果想要check HW info的方法其實有很多種,比如我想看CPU時,我可以打cat /proc/cpuinfo,想看記憶體時可打free -m,想看HDD space時,可透過fdisk -l等等。
在以前我如果想要看電腦的網卡或是顯示是那家的chip時,我會透過dmesg然後配合grep去找出我想要知道的資訊,不過現在發現到一個更好用的指令lspci,可以透過它很簡單的撈出所有PCI devices的資訊,以下是我HP nc6230的info,真是方便呀。
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)
00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 03)
00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 03)
01:00.0 VGA compatible controller: ATI Technologies Inc M22 [Mobility Radeon X300]
02:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG Network Connection (rev 05)
02:06.0 CardBus bridge: Texas Instruments PCIxx21/x515 Cardbus Controller
02:06.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller
02:06.4 Generic system peripheral [0805]: Texas Instruments PCI6411/6421/6611/6621/7411/7421/7611/7621 Secure Digital Controller
02:06.5 Communication controller: Texas Instruments PCI6411/6421/6611/6621/7411/7421/7611/7621 Smart Card Controller
10:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751M Gigabit Ethernet PCI Express (rev 11)
在以前我如果想要看電腦的網卡或是顯示是那家的chip時,我會透過dmesg然後配合grep去找出我想要知道的資訊,不過現在發現到一個更好用的指令lspci,可以透過它很簡單的撈出所有PCI devices的資訊,以下是我HP nc6230的info,真是方便呀。
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)
00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 03)
00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 03)
01:00.0 VGA compatible controller: ATI Technologies Inc M22 [Mobility Radeon X300]
02:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG Network Connection (rev 05)
02:06.0 CardBus bridge: Texas Instruments PCIxx21/x515 Cardbus Controller
02:06.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller
02:06.4 Generic system peripheral [0805]: Texas Instruments PCI6411/6421/6611/6621/7411/7421/7611/7621 Secure Digital Controller
02:06.5 Communication controller: Texas Instruments PCI6411/6421/6611/6621/7411/7421/7611/7621 Smart Card Controller
10:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751M Gigabit Ethernet PCI Express (rev 11)
Thursday, October 18, 2007
Wednesday, October 17, 2007
Mac OSX 10.5 Leopard 即將於2007.10.26 PM6:00開賣
根據官方消息,Apple將於今年的10月26號下午6:00開始於Apple Retail Store開賣MAC OSX 10.5 Leopard,帽客真是感到高興呀!不過在高興之餘忽然驚覺我的iBook,能裝嗎?
於是乎馬上去Apple網站瞧瞧,喔!一進首頁就看到在倒數計時呀!ㄟ~Apple真是個大壞蛋呀!來這招搞得我心癢癢,差點忘了要做什麼,二話不說馬上點選Leopard的Tech Specs的頁面,好險上面有說支援PowerPC G4&G5的CPU,這下子放心的許多,等著升級吧我的小白。
Apple MAC OSX 10.5 Leopard Specs
於是乎馬上去Apple網站瞧瞧,喔!一進首頁就看到在倒數計時呀!ㄟ~Apple真是個大壞蛋呀!來這招搞得我心癢癢,差點忘了要做什麼,二話不說馬上點選Leopard的Tech Specs的頁面,好險上面有說支援PowerPC G4&G5的CPU,這下子放心的許多,等著升級吧我的小白。
Apple MAC OSX 10.5 Leopard Specs
Subscribe to:
Posts (Atom)
