GolangでSSHサーバを作ってみる
by
tsurubee
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
!UTVSVCFF(.01FQBCP *OD %FWFMPQFST4VNNJU'6,60," (PMBOHͰ44)αʔόΛ ࡞ͬͯΈΔ
Slide 2
Slide 2 text
ࣗݾհ (.0ϖύϘגࣜձࣾ ϗεςΟϯάࣄۀ෦ ΠϯϑϥνʔϜ ాതจ !UTVSVCFF ୲αʔϏε
Slide 3
Slide 3 text
օ͞Μɺ44)ͬͨ͜ͱ ͋Γ·͢ΑͶʁ
Slide 4
Slide 4 text
44)ͱʁ w4FDVSF4IFMMͷུশ wΫϥΠΞϯτrαʔόؒʹ͓͚Δ௨৴ͷ҆શੑΛ֬อ͢Δ ͨΊͷϓϩτίϧ w44)ΫϥΠΞϯταʔόͱʹ0QFO44)͕σϑΝΫτ ελϯμʔυ 44)$MJFOU $ ssh -V OpenSSH_7.6p1, LibreSSL 2.6.2 44)4FSWFS &ODSZQU %FDSZQU
Slide 5
Slide 5 text
44)ΫϥΠΞϯτɾαʔό (PMBOHͰ؆୯ʹॻ͚·͢
Slide 6
Slide 6 text
(PMBOHͷಛ wϫϯόΠφϦͰαʔόͷ͕؆୯ w04ϨΠϠʔͷػೳ͕ѻ͍͍͢ʢγεςϜϓϩάϥϛϯάʣ w(PSPVUJOFʹΑΔฒྻॲཧ wඪ४ϥΠϒϥϦͷॆ࣮ɺͳͲͳͲ ϛυϧΣΞ࣮ʹద͍ͯ͠Δ ༻్ʹ͋ͬͨϛυϧΣΞΛࣗ࡞͢Δͱ͍͏બࢶ
Slide 7
Slide 7 text
ࢲͷ߹ɾɾ (PMBOHͰ44)αʔόΛࣗ࡞͢Δ͜ͱͰɺ 44)Λͬͱίϯτϩʔϥϒϧʹ͍ͨ͠ʂ
Slide 8
Slide 8 text
Ϧιʔεϓʔϧ wֹ݄ԁ͔Βར༻Ͱ͖Δʂ wͷཧαʔόͷϦιʔεΛෳͷϢʔβʹఏڙ͢Δʢڞ༻αʔόʣ UTVSVCFF Ϩϯλϧαʔόʔ EFW ෳͷϢʔβͷίϯςϯπ͕ ϩʔΧϧετϨʔδʹ ஔ͞Ε͍ͯΔ TTI TTI TTI TTI TTI TTIUTVSVCFF!TTI TTIEFW!TTI Ϣʔβ༻Ͱ͖Δαʔό͕ TTIͩͱ͍ͬͯΔඞཁ͕͋Δ ϢʔβͱͦͷϢʔβ͕༻͢Δαʔόͷඥ͚͕ଘࡏ͢Δ
Slide 9
Slide 9 text
αʔόఏڙऀଆͷطଘͷ՝ TTIUTVSVCFF!TTI Ϧιʔεϓʔϧ 44)$MJFOU TTI TTI TTI TTI TTI w༻αʔό͕มΘͬͨࡍʹϢʔβʹ௨͕ඞཁ wαʔόཧऀͷ߹Ͱࣗ༝ʹϢʔβ͕͏αʔόΛมߋͰ͖ͳ͍ Ϣʔβ UTVSVCFFTTIʹ ҙࣝతʹଓ͍ͯ͠Δ UTVSVCFFͷίϯςϯπΛ TTIʹҠઃ͍ͨ͠
Slide 10
Slide 10 text
Ϣʔβ͕ଓઌΛҙࣝ͠ͳ͍44)ϓϩΩγαʔό TTIUTVSVCFF!TTIQSPYZ Ϧιʔεϓʔϧ 44)ΫϥΠΞϯτ Ϣʔβ໊ ଓઌϗετ TTIQSPYZ 1MVHHBCMF )PPLT 44)ΛϓϩΩγ wϢʔβ໊ϕʔεͰಈతʹଓઌΛܾఆͰ͖Δ wϢʔβͱଓઌϗετͷඥ͚Λ%#ͰҰݩཧͰ͖ΔFUD Ϣʔβ
Slide 11
Slide 11 text
Α͠ʂʂ࡞Δͧʂʂ
Slide 12
Slide 12 text
(PMBOHͷTTIύοέʔδΛோΊͯΈΔ IUUQTHJUIVCDPNHPMBOHDSZQUPUSFFNBTUFSTTI
Slide 13
Slide 13 text
(PMBOHͷTTIύοέʔδΛோΊͯΈΔ Α͘Θ͔ΒΜ IUUQTHJUIVCDPNHPMBOHDSZQUPUSFFNBTUFSTTI
Slide 14
Slide 14 text
44)αʔόΛॻ͘ʹ 44)ϓϩτίϧΛΔ ඞཁ͕͋Δ
Slide 15
Slide 15 text
ϓϩτίϧΛΔͨΊʹ3'$ΛಡΉ w3'$ɿ44)"VUIFOUJDBUJPO1SPUPDPM Ϣʔβೝূʢύεϫʔυೝূެ։伴ೝূʣ w3'$ɿ44)5SBOTQPSU-BZFS1SPUPDPM τϥϯεϙʔτ w3'$ɿ44)$POOFDUJPO1SPUPDPM νϟωϧ੍ޚϙʔτϑΥϫʔσΟϯά 44)ɺෳͷಠཱͨ͠ϓϩτίϧͰߏ͞ΕΔ
Slide 16
Slide 16 text
44)ϓϩτίϧͷશମΠϝʔδ $MJFOU 4FSWFS 44)$0// 3'$ 44)"65) 3'$ 44)53"/4 3'$ ௨৴ͷ҉߸Խ ηογϣϯ伴ͷަ Ϣʔβೝূ νϟωϧͷଟॏԽ *OUFSOFU wϓϩτίϧͷશମ૾ͷѲॲཧͷྲྀΕΛ௫Ή͜ͱ͕େ w44)ϓϩΩγαʔόΫϥΠΞϯταʔόͷؒʹׂͬͯೖͬͯɺ ҉߸Խ͞ΕͨτϥϯεϙʔτΛհ͢Δඞཁ͕͋Δ
Slide 17
Slide 17 text
TTISͱ͍͏44)ϓϩΩγαʔόΛ࡞ͬͯ·͢ʂ IUUQTCMPHUTVSVCFFUFDIFOUSZ
Slide 18
Slide 18 text
TTISΛͬͯΈΔͱʜ $ ssh
[email protected]
-p 2222
[email protected]
's password: [dev@host-developer ~]$ $ ssh
[email protected]
-p 2222
[email protected]
's password: [summi@host-summit ~]$ ࣮ߦ͢ΔίϚϯυʮϢʔβ໊ʯҎ֎ಉ͕ͩ͡ɺ ҧ͏αʔόʹ44)ϩάΠϯ͢Δ
Slide 19
Slide 19 text
·ͱΊ w(PMBOH04ϨΠϠʔͷػೳΛ؆ܿͳίʔυͰѻ͑ΔͳͲɺ ϛυϧΣΞͷ࣮ʹదͨ͠ಛΛ༗͍ͯ͠Δ wϛυϧΣΞΛࣗ࡞͢Δ͜ͱͰɺ͕ࣗͨͪΓ͍ͨ͜ͱʹ Ϛονͨ͠ͷΛॊೈʹ࡞ΕΔ wϛυϧΣΞͷࣗ࡞ʹ༻͢Δϓϩτίϧͷཧղ͕ඞཁ wTTIS·ͩ։ൃ్্ɻͲ͔͜Ͱ·ͨόʔϯͬͱ͓͠͠·͢ʂ
Slide 20
Slide 20 text
͝ਗ਼ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂʂ