Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
はじめてのしくじり /fjordbootcamp-211009
Search
haruna tsujita
October 08, 2021
Programming
0
1.1k
はじめてのしくじり /fjordbootcamp-211009
haruna tsujita
October 08, 2021
Tweet
Share
More Decks by haruna tsujita
See All by haruna tsujita
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Hotwire or React? ~Reactの録画機能をHotwireに置き換えて得られた知見~ / hotwire_or_react
harunatsujita
8
5.6k
fbc-graduation-napple
harunatsujita
0
78
Rails Girls 2022 LT
harunatsujita
0
520
Other Decks in Programming
See All in Programming
イベント駆動で成長して委員会
happymana
1
340
flutterkaigi_2024.pdf
kyoheig3
0
150
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.5k
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
Functional Event Sourcing using Sekiban
tomohisa
0
100
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Macとオーディオ再生 2024/11/02
yusukeito
0
380
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
React への依存を最小にするフロントエンド設計
takonda
6
1.4k
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
20
1.1k
GraphQLとの向き合い方2022年版
quramy
43
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Site-Speed That Sticks
csswizardry
0
31
Building Adaptive Systems
keathley
38
2.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Designing for Performance
lara
604
68k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Building Your Own Lightsaber
phodgson
103
6.1k
A designer walks into a library…
pauljervisheath
204
24k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Transcript
͡Ίͯͷ͘͠͡Γ SSHଓʹखΛম͍ͨ FJORD BOOT CAMP ॳΊͯͷLTձɹvol.9 napple29ɹΔͳ
ࣗݾհ • napple29 Δͳ • ग़ɿ౦ژ • લ৬ޢࢣɹେֶපӃͷखज़ࣨ / ೝՄอҭԂͷޢࢣ
• 2021.4~ ϑΟϤϧυϒʔτΩϟϯϓͰษڧத • ݱࡏͷϓϥΫςΟεRails
͜ͷLTʹ͍ͭͯ ॳ৺Λࢥ͍ग़͢ܥLT
͜ͷLTʹ͍ͭͯ ॳ৺Λࢥ͍ग़͢ܥLT `ೖձͯ͠12ʙ15ͷ̐ؒΛSSHଓʹඅͨ͜͠ͱ’Λ͖͔͚ͬʹ ࣌ͷࢲֶ͕Μͩ͜ͱΛ͓͠͠·͢
SSHʹ͍ͭͯ ͪΐͬͱͨ͠ࢲ͕ૹΔ
SSHͱʁ • SSHɿSecure SHell • ωοτϫʔΫΛհͯ͠ผͷίϯϐϡʔλʔʹϩάΠϯ͠ɺ ૢ࡞͢ΔͨΊͷιϑτΣΞ
SSHଓͷ͘͠Έ ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ
ൿີ伴 ެ։伴 SSHଓͷ͘͠Έ ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ
ެ։伴 ൿີ伴 ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ SSHଓͷ͘͠Έ
ެ։伴 ϩάΠϯ͍ͨ͠ ൿີ伴 ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ SSHଓͷ͘͠Έ
ൿີ伴 ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ 4283745 SSHଓͷ͘͠Έ ཚ
ެ։伴
ൿີ伴 ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ SSHଓͷ͘͠Έ ฏจ 4283745
ཚ ެ։伴
ൿີ伴 ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ L%*#$!T SSHଓͷ͘͠Έ ҉߸จ
4283745 ཚ ެ։伴
ൿີ伴 ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ SSHଓͷ͘͠Έ 4283745 ެ։伴
ཚ L%*#$!T ҉߸จ
ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ L%*#$!T ൿີ伴 SSHଓͷ͘͠Έ 4283745
ެ։伴 ཚ ҉߸จ
ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ L%*#$!T SSHଓͷ͘͠Έ 4283745 ެ։伴
4283745 ൿີ伴 ཚ ཚ ҉߸จ
ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ L%*#$!T SSHଓͷ͘͠Έ ൿີ伴 {ʓʓ:**}
ϋογϡ {ʓʓ:**} ϋογϡ ެ։伴 ҉߸จ
ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ L%*#$!T SSHଓͷ͘͠Έ ൿີ伴 ҉߸จ
{ʓʓ:**} ϋογϡ {ʓʓ:**} ϋογϡ ެ։伴
ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ L%*#$!T SSHଓͷ͘͠Έ ൿີ伴 {ʓʓ:**}
ϋογϡ {ʓʓ:**} ϋογϡ ެ։伴
҉߸Խ͞Εͨ௨৴ ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ SSHଓͷ͘͠Έ
ͱɺࠓ͜ͷ͘Β͍આ໌Ͱ͖ΔΑ͏ʹͳΓ·͕ͨ͠…
ೖձͨͯ͠ͷΘͨ͠ ԿΛݴ͍ͬͯΔ͔ શ͘Θ͔Βͳ͍
ຓʢΤϯδχΞʣʹΘ͔ΒΜͱݴ͍·͘Δ
ೖձͨͯ͠ͷΘͨ͠ શ͕ͯॳΊͯ
ೖձͨͯ͠ͷΘͨ͠ શ͕ͯॳΊͯ શ͕ͯΑ͘Θ͔Βͳ͍
ೖձͨͯ͠ͷΘͨ͠ શ͕ͯॳΊͯ શ͕ͯΑ͘Θ͔Βͳ͍ શ͕ͯෆ҆
ೖձͨͯ͠ͷΘͨ͠ શ͕ͯॳΊͯ શ͕ͯΑ͘Θ͔Βͳ͍ શ͕ͯෆ҆ པΔਓ͕͍ͳ͍
SSHΓӽ͑ΒΕΔؾ͕͠ͳ͍… ͦͯ͠ɺͱʹ͔͘Ή
࣭Λ͏·͘Ͱ͖ͳ͍
• wakaranνϟϯωϧͰฉ͍ͯΈΔ ࣭ͯ͠ΈΔ͕…
• wakaranνϟϯωϧͰฉ͍ͯΈΔ • ͕ࣝͳͯࣗ͘ͷঢ়گΛ͏·͘આ໌Ͱ͖ͳ͍ ࣭ͯ͠ΈΔ͕…
• wakaranνϟϯωϧͰฉ͍ͯΈΔ • ͕ࣝͳͯࣗ͘ͷঢ়گΛ͏·͘આ໌Ͱ͖ͳ͍ • ฉ͖͍ͨ͜ͱͨ͘͞Μ͋ΔͷʹɺͦΕҎ্ฉ͚ͳ͍ ࣭ͯ͠ΈΔ͕…
• wakaranνϟϯωϧͰฉ͍ͯΈΔ • ͕ࣝͳͯࣗ͘ͷঢ়گΛ͏·͘આ໌Ͱ͖ͳ͍ • ฉ͖͍ͨ͜ͱͨ͘͞Μ͋ΔͷʹɺͦΕҎ্ฉ͚ͳ͍ • ࣭λΠϜͰฉ͖͍͕ͨɺ༐ؾ͕ͳͯ͘ฉ͚ͳ͍… ࣭ͯ͠ΈΔ͕…
༻ޠΛཧղͤͣʹϓϥΫςΟεʹऔΓΉ
༻ޠΛཧղͤͣʹϓϥΫςΟεʹऔΓΉ EX. $ ΛҰൠϢʔβʔͩͱ͔͍ͬͯͳ͔ͬͨ
ൿີ伴 ެ։伴 $ ssh-keygen -t rsa ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ
ʢ͘͞ΒVPSͳͲʣ ྫɹ$ ΛҰൠϢʔβʔͩͱ͔͍ͬͯͳ͔ͬͨ
ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ ྫɹ$ϚʔΫ͕ҰൠϢʔβʔͩͱ͔͍ͬͯͳ͔ͬͨ 1.ઃఆϑΝΠϧΛૢ࡞ $ vi
/etc/ssh/sshd_config
2.ެ։伴Λஔ͘ॴΛ༻ҙ $ mkdir .ssh ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ
ʢ͘͞ΒVPSͳͲʣ ྫɹ$ϚʔΫ͕ҰൠϢʔβʔͩͱ͔͍ͬͯͳ͔ͬͨ 1.ઃఆϑΝΠϧΛૢ࡞ $ vi /etc/ssh/sshd_config
ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ ಉ͡ϢʔβʔͰૢ࡞͠ͳͯ͘ͳΒͳ͍ ྫɹ$ϚʔΫ͕ҰൠϢʔβʔͩͱ͔͍ͬͯͳ͔ͬͨ
rootͰߦ͍ͬͯͨ ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ ʢ͘͞ΒVPSͳͲʣ ྫɹ$ϚʔΫ͕ҰൠϢʔβʔͩͱ͔͍ͬͯͳ͔ͬͨ
permission denied. ެ ։ 伴 ΫϥΠΞϯτଆ ʢࣗʣ αʔόʔଆ
ʢ͘͞ΒVPSͳͲʣ ൿີ伴 ྫɹ$ϚʔΫ͕ҰൠϢʔβʔͩͱ͔͍ͬͯͳ͔ͬͨ
’ࢲҰੜSSHଓͰ͖ͳ͍͔’
• ̍ͭΘ͔Δͱɺ·ͨ̍ͭΘ͔Βͳ͍͜ͱͱग़ձ͏ ࣌ɺ͘͢͝য͍ͬͯͨ
• ̍ͭΘ͔Δͱɺ·ͨ̍ͭΘ͔Βͳ͍͜ͱͱग़ձ͏ • ૣ͘ଔۀͯ͠ಇ͖͍ͨ ࣌ɺ͘͢͝য͍ͬͯͨ
• ̍ͭΘ͔Δͱɺ·ͨ̍ͭΘ͔Βͳ͍͜ͱͱग़ձ͏ • ૣ͘ଔۀͯ͠ಇ͖͍ͨ • ͏ΤϯδχΞఘΊͯɺޢࢣʹΖ͏͔ͳ… ࣌ɺ͘͢͝য͍ͬͯͨ
• ̍ͭΘ͔Δͱɺ·ͨ̍ͭΘ͔Βͳ͍͜ͱͱग़ձ͏ • ૣ͘ଔۀͯ͠ಇ͖͍ͨ • ͏ΤϯδχΞఘΊͯɺޢࢣʹΖ͏͔ͳ… ࣗͰͲ͏ʹͰ͖ͳ͍ͱޛΓɺQˍAͰ࣭ͯ͠Έͨͱ͜Ζ… ࣌ɺ͘͢͝য͍ͬͯͨ
Ͱղܾ🎉 ɹ
͘͠͡ΓɹʹɹSSHଓʹۤઓ͍ͯ͠Δͱ͖ͷࣗ
• ʲશ͘Θ͔Βͳ͍͜ͱ͕Θ͔ͬͨܦݧʳ͕ࣗ৴ʹͳͬͨ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ʲશ͘Θ͔Βͳ͍͜ͱ͕Θ͔ͬͨܦݧʳ͕ࣗ৴ʹͳͬͨ • ࠓͰԿ͔ʹͭ·ͮ͘ͱʮͰSSHͰ͖͔ͨΒେৎʯͱࢥ͑Δ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ίϛϡχςΟʹର͢Δ҆৺ײ͕ժੜ͑ͨ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ίϛϡχςΟʹର͢Δ҆৺ײ͕ժੜ͑ͨ • ใʹ࿈ɹɹϚʔΫ → ϝϯλʔ͞Μ͕ݟʹདྷͯ͘Ε͍ͯͨ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ίϛϡχςΟʹର͢Δ҆৺ײ͕ժੜ͑ͨ • ใʹ࿈ɹɹϚʔΫ → ϝϯλʔ͞Μ͕ݟʹདྷͯ͘Ε͍ͯͨ • ࣮ݟकΒΕ͍ͯΔ͜ͱ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ίϛϡχςΟʹର͢Δ҆৺ײ͕ժੜ͑ͨ • ใʹ࿈ɹɹϚʔΫ → ϝϯλʔ͞Μ͕ݟʹདྷͯ͘Ε͍ͯͨ • ࣮ݟकΒΕ͍ͯΔ͜ͱ • ॿ͚ͯΒ͑ΔίϛϡχςΟͩͱ͔ͬͯ҆৺ͨ͠
͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ࠀͰ͖͍ͯͳ͍͜ͱͨ͘͞Μ… ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ࠀͰ͖͍ͯͳ͍͜ͱͨ͘͞Μ… • ·ͩ·ͩൃల్্ɺઈࢍͰ͖ͳ͍ࣗͱ͖߹͍த ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ࠀͰ͖͍ͯͳ͍͜ͱͨ͘͞Μ… • ·ͩ·ͩൃల్্ɺઈࢍͰ͖ͳ͍ࣗͱ͖߹͍த • ͘͠͡Δ͔Βͦ͜ɺௐΔɺखΛಈ͔͢ɺֶͿʂ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ࠀͰ͖͍ͯͳ͍͜ͱͨ͘͞Μ… • ·ͩ·ͩൃల్্ɺઈࢍͰ͖ͳ͍ࣗͱ͖߹͍த • ͘͠͡Δ͔Βͦ͜ɺௐΔɺखΛಈ͔͢ɺֶͿʂ ͬͯ͘͠͡ԕճΓ͢Δͷɺѱ͘ͳ͍ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠