跳到主要內容

發表文章

目前顯示的是有「System Administration」標籤的文章

Dell OM SMTD DVD Download

Dell 的伺服器更新光碟從官方網站上不曉得為什麼都無法下載 最後還是用關鍵字找到了有人分享的 link... Dell Systems Management Tools and Documentation DVD ISO, v.7.4 (Last Updated 25/04/2014) ftp://ftp.dell.com/secure//FOLDER02027063M/1/OM_SMTD_740_A00.iso 其實就是進 dell 的 ftp server /secure/ folder 下撈. 理論上用日期去排序資料夾,就可以找到最新的下載連結 但是不曉得為什麼 OM_SMTD_730 資料夾的修改日期竟然比 740 的還新  lol... 如果有需要 prepare 新的 server,  可能會用到 Dell Systems Build and Update Utility v2.4 ... 每一陣子要 upgrade 伺服器就要這樣搞一次..... Update: OM_SMTD 只能進 System Build and Utility Updater (SBUU),裡面也沒有更新檔,看來是要進 Life Cycle Controller 然後透過網路到 dell.ftp.com 下載比較快的樣子‧‧‧‧

user specific sshd config

When ssh to some AWS EC2 AMI such as RedHat , Amazon Linux and Ubuntu, ssh will prompt some message like below: Please login as the user "ec2-user" rather than the user "root". The secret is here: # cat /root/.ssh/authorized_keys no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"ec2-user\" rather than the user \"root\".';echo;sleep 10" Summary: You can define user-specific sshd config in ~/.ssh/authorized_keys file

time filed and time taken field in IIS log

IIS 的 log file 有一些很有趣的東西。分別是 time filed 和最後的 time taken欄位。 如果有一筆record長成這樣: #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip sc-status sc-substatus sc-win32-status time-taken 2012-11-28 22:25:17 192.168.0.21 GET /Main.aspx - 80 AWalker 192.168.0.100 200 0 0 764 那麼 time filed 的 22:25:17 代表的是 request 送到 server 的時間嗎? time taken filed 的 764 則是代表 server 共花了 0.764 second 完成了這項 request,那要怎麼定義完成? server 送出就算了嗎? 我的答案是: 22:25:17 是 server 完成這筆 request 的時間。client 發出這筆 request 的 時間必需往前回推。 而 time taken 則會包括 client acknowledge 的時間,並不僅僅是 server 運算處理完畢的時間。 ref: what-does-the-time-field-in-the-log-indicate-exactly time-vs-time-taken-fields-in-iis-logging http://forums.iis.net/t/1188041.aspx

[note] ssh public key authentication

測試環境的機器太多,開始厭倦每次都要打密碼了... 先找一台最常用的機器產生 rsa key pair ssh-keygen -t rsa 回答完問題後 ~/.ssh/ 目錄下就會有 id_rsa 和 id_rsa.pub ( 千萬要保護好 id_rsa key!! ) 把 id_rsa.pub 的內容放進想要可以用 public key authentication 登入的機器上 scp id_rsa.pub to target client. cat id_rsa.pub >> .ssh/authorized_keys 最常卡住的原因是: 1. target 機器連 scp 都沒有, =>  裝 openssh-clients 2. target 機器的 .ssh folder 和 authorized_keys 的權限 => chmod 400 and 600 3. selinux 不允許 sshd 去讀取 authorized_keys => 做完步驟2後 restorecon -R -v .ssh 4. authorized_keys 名字打錯 => 把手砍掉 確認檔名有沒有打錯字 如果要讓 windows putty 也可以用 id_rsa 來登入已經放好對應 authorized_keys 的 target client, 就需要用 puttygen -> import key (id_rsa) -> 另存 ppk 檔 ( 千萬要保護好這把ppk!! ) 另外 TortoiseGit 會吃 putty default 設定的 private key for authentication, 所以記得讓 putty default 設定的 private key 保持清空,真的有需要的話請用 pagent 來管理多把不同的 private key.

Mutiple listening squid w/wo authentication

squid 要設定 ncsa_auth 認證其實不難, 有趣的是我們也可以利用 myport 來產生一個 acl squid 的 acl 跟 iptalbes 的 rule 很像, first match first apply. 所以我們可以設定從某些 port 來的 request 不需要密碼驗證, 其他的則必須要密碼驗證。另外也可以加入允許連連線的來源網址,只要注意規則的順序就好囉! # vi /etc/squid/squid.conf  http_port = 3128  # listensing port B http_port = 9999  # listensing port B   # Enable ncsa_auth  (htpasswd -c /etc/squid/passwd username ) auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 2 hours auth_param basic casesensitive off   # Add filter for ncsa auth acl lab_lan src 172.18.0.0/22 172.18.4.0/22 # multiple CIDR network acl ncsa_users proxy_auth REQUIRED acl no_auth myport 9999 http_access allow no_auth lab_lan http_access allow ncsa_users lab_lan # Deny others ...   http_access deny all

Transform putty ppk key to OpenSSH authorized_keys

在登入EC2的機器時,我們常會將 ssh key pair 轉換成 putty 的 ppk 以方便遠端登入。如果有天需要將這把 ppk 轉換成 OpenSSH 可以使用的 public key 要怎麼辦呢? 使用 puttygen 讀取 ppk,  接著點選 Save public key 將 public key 的內容存成遠端機器上的純文字檔 ssh-keygen -i -f {純文字檔} > OpenSSH_authorized_key cat openssh_authorized_key >> ~/.ssh/authorized_keys 這樣就可以用 ppk 來登入遠端的機器囉!