Enable sshd
# echo 'sshd_enable="YES"' >> /etc/rc.conf
# /etc/rc.d/sshd start
# /etc/rc.d/sshd start
ျပီးရင္ rsa keys မထုတ္ရေသးရင္ generate လုပ္ေပးရေအာင္ ေအာက္က command ကို run ပါမယ္။ က်ေနာ္တို့ normal user အေနနဲ့ ထုတ္မွာျဖစ္လို့ root user ကေန exit လုပ္ေပးပါ။
$ ssh-keygen -t rsa
အဲဒါဆိုရင္ က်ေနာ္တို့ .ssh/id_rsa နဲ့ .ssh/id_rsa.pub ဖိုင္ေတြကို ကိုယ့္ရဲ့ home directory ထဲမွာေတြ့မွာပါ။ ျပီးရင္ က်ေနာ္တို့ certificate authentication နည္းသံုးမွာျဖစ္တဲ့အတြက္ id_rsa.pub ဖိုင္ကို authentication keys အေနနဲ့ ေျပာင္းရေအာင္ ေအာက္က command ကို run ေပးပါမယ္။
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ျပီးရင္ က်န္တဲ့ ~/.ssh/id_rsa ဆိုတဲ့ private key ကို ကိုယ့္ usb disk ထဲပဲျဖစ္ျဖစ္ internet ေပာ္ လံုျခံုတဲ့ ကိုယ္ပဲ access လုို့ရနိုင္မယ့္ေနရာထဲ ကူးထည့္ ဒါမွမဟုတ္ upload လုပ္ျပီး အျခား Client အေနနဲ့သံုးမယ့္ စက္ထဲကို copy ကူးထည့္ေပးပါ။ ဥပမာ က်ေနာ္က အဲဒီ private key ကို က်ေနာ့္ ubuntu စက္ထဲကို ကူးထည့္ေပးလိုက္မယ္။ ဘယ္ေနရာမွာကူးထည့္ေပးရမလဲဆိုေတာ့ ~/.ssh directory ေအာက္ကိုပါ။ အဲလိုကူးထည့္ျပီးဆိုရင္ေတာ့ ~/.ssh/id_rsa အေနနဲ့ေတြ့မွာပါ။ အဲဒါေတြလုပ္ေပးျပီးရင္ေတာ့ က်ေေနာ္တို့ FreeBSD Server ထဲကို Client Ubuntu ကေန ဝင္နိုင္ပါျပီး။ ေအာက္ကနမူနာ command ေလးနဲ့ ဝင္လို့ရပါတယ္။
$ ssh user@freebsd
ေအာက္ကနမူနာ Screenshots ေလးေတြကို ျကည့္ပါ။





ဘယ္ေလာက္လြယ္ကူသလဲ!
References:
OpenSSH
Enjoy!
No comments:
Post a Comment