安裝的方法非常簡單,將tarball檔抓下來後,進入到解開的目錄中執行:make;make install即可安裝成功,而執行時直接打dmidecode就可以了,配合重新輸出導向,就可將此info記錄到某一檔案中。
Friday, October 31, 2008
dmidecode
Windows下相信大家常用cpuz去查看主機板的詳細資訊,而Linux下則可用dmidecode這個工具來查看,這邊是dmidecode官網的example: dmidecode example。
Wednesday, October 22, 2008
Check USB status in Linux
簡單介紹一下如何在Linux OS下查看USB的控制器與其它資訊,一個非常簡單的方法是透過lspci,如下所示:
[root@s1 ~]# lspci | grep -i usb
00:07.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 16)
00:07.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 16)
可以看出這台老PC只支援USB 1.x
PS. USB 控制器:
-UHCI: USB 1.x Inetl/VIA mb
-OHCI: USB 1.x 非Intel/VIA mb
-EHCI: USB 2.0
另外一個包含非常多USB資訊的檔案:
[root@s1 ~]# cat /proc/bus/usb/devices
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.18-53.el5 uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:07.3
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.18-53.el5 uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:07.2
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
Wednesday, October 15, 2008
利用PAM限制SSH login的user account
實作起來非常簡單,兩個設定即可,請參考如下:
需求:只允許root與u1可以ssh login至本機
1. 建立user list:
# vi /etc/ssh/ssh_users
root
u1
2. 修改/etc/pam.d/sshd:
#%PAM-1.0
#auth include system-auth
auth required pam_listfile.so item=user sense=allow file=/etc/ssh/ssh_users onerr=fail
account required pam_nologin.so
account include system-auth
password include system-auth
session optional pam_keyinit.so force revoke
session include system-auth
session required pam_loginuid.so
立即生效~
* sense=allow 代表名列於/etc/ssh/ssh_users的user才可ssh login, 反過來說當sense=deny時代表ssh_users中的account不可ssh login。
*onerr=fail 代表當/etc/ssh/ssh_users無法開啟或是檔案不存在時,當作失敗,反之onerr=succeed代表不管能不能讀取到檔案都成功。
Subscribe to:
Posts (Atom)