SSH โดยไม่ต้องใส่รหัสผ่าน
Posted by กวิน ชัยเลิศ on Friday, January 16th, 2009สำหรับผู้ดูแลระบบที่มีความจำเป็นต้องใช้งาน Remote Login ผ่าน OpenSSH Client อยู่เป็นประจำไม่ว่าจะใช้งานบน Linux, *BSD, Mac OS X คงจะเกิดอาการเบื่อไม่น้อยที่ต้องพิมพ์ Password ทุกๆ ครั้งที่ต้องการจะ Login (ไม่นับ Password จำพวก 123456 นะครับ) ทางออกสำหรับผู้ที่ต้องการ Login โดยไม่ต้องพิมพ์ Password แถมยังคงความปลอดภัยตามแบบฉบับของ OpenSSH สามารถทำได้ตามวิธีดังต่อไปนี้ครับ
ระบบที่ทำการทดสอบ
- OpenSSH Client บน Mac OS X 10.5.6
- OpenSSH Server บน Ubuntu 8.04
ขั้นตอนแรก ทำการสร้าง keys สำหรับยืนยันตัวตนระหว่าง Client และ Server (ทำบนเครื่อง Client ในที่นี้คือ Mac OS X)
MacClient:~ UserA$ ssh-keygen -t rsa
MacClient:~ UserA$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/Users/UserA/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/UserA/.ssh/id_rsa. Your public key has been saved in /Users/UserA/.ssh/id_rsa.pub. The key fingerprint is: a4:74:0b:bc:2f:d1:f5:c7:4e:90:51:7f:f4:45:84:a0 UserA@MacClient