.PPK File key putty Working Mac And Liux (terminal)
วันก่อนทำงาน ได้รับ ไฟล์เป็น .ppk เราว่าจะ ssh เข้า server ได้อย่างไร ตอนแรกนึกว่าเป็น ของ fileZilla แต่ลอง import แล้วไม่ได้ เลยมานั่ง google ดู อ๋อเป็น ไฟล์ key ของ putty ที่อยู่ใน windows กำ!!! เรา ใช้เอาไง และต้องการใช้ บน mac เท่านั้น ขก ไปเปิดเครื่อง windows จ้า ….
อ๋อ เป็น AWS นะ
มา อ้างอิง https://stackoverflow.com/questions/3475069/use-ppk-file-in-mac-terminal-to-connect-to-remote-connection-over-ssh
คำสั่ง แรก install putty
sudo port install putty
or
brew install putty
ตัวอย่างการแปลง
puttygen privatekey.ppk -O private-openssh -o privatekey.pem
Format
puttygen [inputpath/file.ppk] -O private-openssh -o [output path/namefile.pem]
Mac on Terminal. ใช้งานได้แล้ว
ssh -i privatekey.pem user@my.server.com
เอา ไปรองใช้กันดู ถ้าไม่ได้ ลองเอา sudo ต่อหน้านะ