Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, December 07, 2011

Wednesday, March 16, 2011

Race Condition of Memcached

最近在思考使用 memcached 時產生的 race condition 的問題, 因此開始 Google 了一些資料, 目前找到最有用的資料莫過於官網上的文件, 原理還算簡單易懂, 但因為沒有使用過這種方案的經驗, 還不知道實際執行的效果為何, 下個月應該就能作實驗了吧, 希望能有不錯的收獲!

Wednesday, March 10, 2010

SSH 免打登入密碼設定流程

我想要從 A 主機(192.168.1.200) 登入到 B 主機(192.168.1.250)

先登入 A 主機(假設是用webuser登入), 執行下面的指令
[webuser@A webuser]$ cd /home/webuser/.ssh/
[webuser@A .ssh]$ ssh-keygen -d 之後都按Enter
Generating public/private dsa key pair.
Enter file in which to save the key (/home/webuser/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/webuser/.ssh/id_dsa.
Your public key has been saved in /home/webuser/.ssh/id_dsa.pub.
The key fingerprint is:
8d:10:91:1a:6a:52:20:13:25:2c:58:b8:66:cb:67:e4 webuser@www.example.com

接下來將生成的 key 上傳到 B 主機 (假設是要用 test_user 登入 B 主機)
[webuser@A .ssh]$ scp id_dsa.pub test_user@192.168.1.250:/home/test_user/.ssh/authorized_keys
這樣就完成
要注意一下, 上傳到 B 主機的檔名要改成 authorized_keys, 若 B 主機上已經有 authorized_keys 的檔案, 改成 authorized_keys2 的檔名, 其他依此推類~

最後用下面的指令在 A 主機上測試
[webuser@A .ssh]$ ssh test_user@192.168.1.250
基本上應該是不用輸入密碼就直接登入 B 主機了