Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
はじめてのしくじり /fjordbootcamp-211009
Search
haruna tsujita
October 08, 2021
Programming
1.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
はじめてのしくじり /fjordbootcamp-211009
haruna tsujita
October 08, 2021
More Decks by haruna tsujita
See All by haruna tsujita
Rebuilding Turbo Streams with ruby.wasm and Ruby Sockets
harunatsujita
1
2.3k
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
310
Hotwire or React? ~Reactの録画機能をHotwireに置き換えて得られた知見~ / hotwire_or_react
harunatsujita
11
11k
fbc-graduation-napple
harunatsujita
0
130
Rails Girls 2022 LT
harunatsujita
0
670
Other Decks in Programming
See All in Programming
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
130
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
250
JRuby: Past, Present, and Future
headius
0
230
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
650
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
ChromeでローカルLLM
ryu1013
0
110
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
250
phperだってパンチカードでコーディングしたい
o0h
PRO
0
300
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
22
22k
The Rails Doctrine Decade
koic
2
570
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
210
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
590
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
WCS-LA-2024
lcolladotor
0
880
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
Writing Fast Ruby
sferik
630
63k
Become a Pro
speakerdeck
PRO
31
6.3k
My Coaching Mixtape
mlcsv
0
350
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Automating Front-end Workflow
addyosmani
1369
210k
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Ͱ͖͔ͨΒେৎʯͱࢥ͑Δ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ίϛϡχςΟʹର͢Δ҆৺ײ͕ժੜ͑ͨ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ίϛϡχςΟʹର͢Δ҆৺ײ͕ժੜ͑ͨ • ใʹ࿈ɹɹϚʔΫ → ϝϯλʔ͞Μ͕ݟʹདྷͯ͘Ε͍ͯͨ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ίϛϡχςΟʹର͢Δ҆৺ײ͕ժੜ͑ͨ • ใʹ࿈ɹɹϚʔΫ → ϝϯλʔ͞Μ͕ݟʹདྷͯ͘Ε͍ͯͨ • ࣮ݟकΒΕ͍ͯΔ͜ͱ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ίϛϡχςΟʹର͢Δ҆৺ײ͕ժੜ͑ͨ • ใʹ࿈ɹɹϚʔΫ → ϝϯλʔ͞Μ͕ݟʹདྷͯ͘Ε͍ͯͨ • ࣮ݟकΒΕ͍ͯΔ͜ͱ • ॿ͚ͯΒ͑ΔίϛϡχςΟͩͱ͔ͬͯ҆৺ͨ͠
͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ࠀͰ͖͍ͯͳ͍͜ͱͨ͘͞Μ… ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ࠀͰ͖͍ͯͳ͍͜ͱͨ͘͞Μ… • ·ͩ·ͩൃల్্ɺઈࢍͰ͖ͳ͍ࣗͱ͖߹͍த ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ࠀͰ͖͍ͯͳ͍͜ͱͨ͘͞Μ… • ·ͩ·ͩൃల్্ɺઈࢍͰ͖ͳ͍ࣗͱ͖߹͍த • ͘͠͡Δ͔Βͦ͜ɺௐΔɺखΛಈ͔͢ɺֶͿʂ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
• ࠀͰ͖͍ͯͳ͍͜ͱͨ͘͞Μ… • ·ͩ·ͩൃల్্ɺઈࢍͰ͖ͳ͍ࣗͱ͖߹͍த • ͘͠͡Δ͔Βͦ͜ɺௐΔɺखΛಈ͔͢ɺֶͿʂ ͬͯ͘͠͡ԕճΓ͢Δͷɺѱ͘ͳ͍ ͘͠͡Γ͔ΒֶΜͩ͜ͱ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠