startup-it-troubleshooting について
エンジニアが IT も担うスタートアップや小規模チーム向けのトラブルシューティングスキルです。ID、ネットワーク、端末、入退社対応、セキュリティインシデントの手順とコマンドをまとめています。
主な機能
- 01ID・MFA の復旧コマンド
- 02Wi-Fi、DNS、VPN の診断
- 03ノート PC と OS の保守
- 04入社・退職時の手順
- 05メール、会議、周辺機器の対処
- 06セキュリティインシデント対応
活用シーン
- 01従業員のアカウントロック解除と MFA 復旧
- 02Wi-Fi や VPN の接続障害の調査
- 03新入社員のアカウントと端末の準備
- 04アクセス権の取り消しと紛失端末への対応
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ bagelhole/ devops-security-agent-skills --skill startup-it-troubleshootingインストール後、Claude Code で/startup-it-troubleshootingを入力して読み込まれたか確認します。
詳細
スタートアップのITトラブルシューティング
エンジニアがIT部門も兼任するスタートアップや小規模チーム向けのランブックです。
使用するタイミング
あなたは「成り行きでIT担当になった人」です。IT担当という肩書きの人はいませんが、ノートPCがフリーズし、投資家向けのデモ中にWi-Fiが切れ、深夜に誰かがGoogle Workspaceから締め出され、新入社員が月曜日にアカウントなしで入社します。このスキルを使えば、あらゆる状況に対応するためのコピー&ペースト可能なコマンドを利用できます。
優先順位に基づくトリアージ:(1)全社的な障害、(2)経営陣や顧客対応の妨げになる問題、(3)チーム全体のパフォーマンス低下、(4)個人のワークステーションの問題。必ず「影響を受けている人は何人ですか?」と「収益に影響していますか?」を確認してください。
SSO/IDロックアウト
GAMを使用したGoogle Workspace
bash <(curl -s -S -L https://gam-shortn.appspot.com/gam-install) # install GAM
gam oauth create # authorize
gam update user [email protected] password "TempPass123!" changepassword on # reset password
gam update user [email protected] suspended off # unsuspend locked-out user
gam user [email protected] signout # force sign-out all sessions
gam user [email protected] update backupcodes # new MFA backup codes
gam user [email protected] turnoff2sv # disable 2SV (re-enable within 24h)
Okta API
OKTA="company.okta.com"; T="your-api-token"; UID="00u1abcdef"
curl -X POST -H "Authorization: SSWS $T" "https://$OKTA/api/v1/users/$UID/lifecycle/unlock"
curl -X POST -H "Authorization: SSWS $T" "https://$OKTA/api/v1/users/$UID/lifecycle/reset_password?sendEmail=true"
curl -X POST -H "Authorization: SSWS $T" "https://$OKTA/api/v1/users/$UID/lifecycle/reset_factors"
curl -X DELETE -H "Authorization: SSWS $T" "https://$OKTA/api/v1/users/$UID/sessions"
MFAの復旧手順: ビデオ通話で本人確認を行い、バックアップコードを生成するか認証要素をリセットします。ユーザーには直ちに再登録してもらい、古いデバイスの登録が解除されていることを確認し、インシデントを記録します。
ネットワークのトラブルシューティング
Wi-Fiのデバッグ
# macOS
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
networksetup -setairportpower en0 off && sleep 2 && networksetup -setairportpower en0 on
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder
# Linux
nmcli device wifi list && nmcli connection show --active
nmcli device disconnect wlan0 && nmcli device connect wlan0
sudo systemd-resolve --flush-caches
netsh wlan show interfaces
netsh wlan disconnect; netsh wlan connect name="OfficeWiFi"
ipconfig /flushdns
netsh winsock reset # full stack reset, reboot after
DNSの問題
nslookup company.com 8.8.8.8 # test against known-good DNS
dig @1.1.1.1 company.com # Linux/macOS detail
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4 # macOS temp override
$a = Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
Set-DnsClientServerAddress -InterfaceIndex $a.ifIndex -ServerAddresses ("8.8.8.8","8.8.4.4")
VPNに接続できない
nc -zv vpn.company.com 443 # test port reachability
sudo wg show # WireGuard status
sudo wg-quick down wg0 && sudo wg-quick up wg0 # restart WireGuard
tailscale status && sudo tailscale up --reset # Tailscale re-auth
インターネットが遅い
speedtest-cli --simple # bandwidth test (pip install speedtest-cli)
ping -c 50 8.8.8.8 # packet loss check
networkQuality -s # macOS 12+ bufferbloat test
ノートPCのパフォーマンス
ディスク容量
df -h # volume overview
du -sh ~/* | sort -rh | head -15 # biggest dirs in home
docker system df # Docker disk usage (common culprit)
docker system prune -a --volumes # reclaim Docker space
brew cleanup --prune=all # macOS Homebrew cleanup
Get-PSDrive -PSProvider FileSystem | Select Name,@{N='Free(GB)';E={[math]::Round($_.Free/1GB,2)}}
Get-ChildItem C:\ -Recurse -File -EA SilentlyContinue | Sort Length -Desc | Select -First 15 FullName,@{N='MB';E={[math]::Round($_.Length/1MB,2)}}
メモリの逼迫と暴走するプロセス
# macOS
memory_pressure
top -o rsize -l 1 -n 10 -stats pid,command,rsize
pkill -f "Google Chrome Helper"
# Linux
free -h && ps aux --sort=-%mem | head -11
sudo dmesg | grep -i "oom\|out of memory"
Get-Process | Sort WorkingSet64 -Desc | Select -First 10 Name,@{N='MB';E={[math]::Round($_.WorkingSet64/1MB,2)}}
Stop-Process -Name "Teams" -Force
バッテリーの状態
system_profiler SPPowerDataType | grep -E "Cycle Count|Condition" # macOS
upower -i /org/freedesktop/UPower/devices/battery_BAT0 # Linux
powercfg /batteryreport /output "$env:USERPROFILE\Desktop\battery.html"
macOSの管理
profiles status -type enrollment # MDM enrollment check
sudo systemsetup -setremotelogin on # enable SSH for remote admin
# Homebrew fleet setup — standard Brewfile
cat > Brewfile <<'EOF'
brew "git"; brew "node"; brew "[email protected]"; brew "awscli"; brew "jq"; brew "gh"
cask "google-chrome"; cask "slack"; cask "1password"; cask "visual-studio-code"; cask "docker"; cask "zoom"
EOF
brew bundle install --file=Brewfile
brew bundle dump --file=~/Brewfile --force # export current setup
# FileVault
sudo fdesetup status && sudo fdesetup enable # store recovery key in 1Password
# Updates
softwareupdate -l && sudo softwareupdate -ia --restart
Windowsの管理
gpresult /r; gpupdate /force # check and refresh Group Policy
# Windows Update
Install-Module PSWindowsUpdate -Force -Scope CurrentUser
Install-WindowsUpdate -AcceptAll -AutoReboot
# If stuck: reset update components
Stop-Service wuauserv,cryptSvc,bits,msiserver -Force
Remove-Item "C:\Windows\SoftwareDistribution" -Recurse -Force
Start-Service wuauserv,cryptSvc,bits,msiserver
# BitLocker
manage-bde -status C:
Enable-BitLocker -MountPoint "C:" -EncryptionMethod XtsAes256 -UsedSpaceOnly -TpmProtector
# Remote Desktop
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name "fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
Linuxデスクトップ
# Ubuntu — fix broken packages
sudo apt --fix-broken install && sudo dpkg --configure -a && sudo apt update && sudo apt upgrade -y
# Fedora — fix broken packages
sudo dnf check && sudo dnf distro-sync && sudo dnf update -y
# Service failures
systemctl --failed
journalctl -p err -b
# Drivers
sudo ubuntu-drivers autoinstall # Ubuntu proprietary drivers
lspci | grep -i vga && sudo lshw -C display # GPU info
sudo dmesg | grep -i firmware # missing firmware
# Display issues
xrandr --auto # reset to auto-detect
xrandr --output HDMI-1 --mode 1920x1080 --rate 60 # force resolution
echo $XDG_SESSION_TYPE # Wayland vs X11 check
メール/カレンダーの問題
Google Workspace
gam user [email protected] show forwarding # check rogue forwarding rules
gam user [email protected] delete forwarding # remove forwarding
gam user [email protected] show delegates # check email delegation
gam user [email protected] show filters # check mail filters
Microsoft 365
Install-Module ExchangeOnlineManagement -Force -Scope CurrentUser
Connect-ExchangeOnline -UserPrincipalName [email protected]
Get-MessageTrace -SenderAddress [email protected] -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date)
Get-MailboxStatistics -Identity [email protected] | Select DisplayName,TotalItemSize
メールの到達性
dig TXT company.com | grep "v=spf1" # SPF
dig TXT google._domainkey.company.com # DKIM
dig TXT _dmarc.company.com # DMARC
オンボーディングのチェックリスト
# 1. Google Workspace account
gam create user [email protected] firstname "Jane" lastname "Smith" \
password "Welcome2Company!" changepassword on org "/Engineering"
gam update group [email protected] add member [email protected]
# 2. 1Password
op user provision --email [email protected] --name "Jane Smith"
# 3. Slack
curl -X POST "https://slack.com/api/admin.users.invite" \
-H "Authorization: Bearer xoxp-your-admin-token" \
-d "[email protected]&channel_ids=C01GENERAL,C02ENGINEERING&team_id=T01YOURTEAM"
# 4. GitHub
gh api orgs/your-company/invitations -f email="[email protected]" -f role="direct_member"
gh api orgs/your-company/teams/engineering/memberships/newhire-username -f role="member" -X PUT
# 5. VPN / Tailscale
tailscale up --authkey tskey-auth-abc123
初日のセットアップスクリプト(macOS)
新入社員にこのスクリプトを渡します。Homebrewをインストールし、ホストされているBrewfileから標準ツールをインストールし、Gitを設定し、GitHub CLIで認証し、主要なリポジトリをクローンして、FileVaultを有効にします。
#!/bin/bash
set -e
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
curl -sL https://internal.company.com/setup/Brewfile -o /tmp/Brewfile && brew bundle install --file=/tmp/Brewfile
read -p "Full name: " N; read -p "Email: " E
git config --global user.name "$N" && git config --global user.email "$E" && git config --global pull.rebase true
gh auth login && mkdir -p ~/src && cd ~/src && gh repo clone your-company/main-app
sudo fdesetup enable
オフボーディングのチェックリスト
誰かが退職したら、これらを直ちに実行します。セキュリティのためにはスピードが重要です。
gam update user [email protected] suspended on # 1. block all access
gam user [email protected] signout # 2. kill sessions
gam user [email protected] transfer drive [email protected] # 3. transfer Drive
gam user [email protected] add delegate [email protected] # 4. delegate email 30d
curl -X POST "https://slack.com/api/admin.users.remove" \
-H "Authorization: Bearer xoxp-your-admin-token" \
-d "user_id=U01DEPARTED&team_id=T01YOURTEAM" # 5. remove Slack
gh api orgs/your-company/members/departed-username -X DELETE # 6. remove GitHub
op user suspend [email protected] # 7. revoke 1Password
aws iam delete-login-profile --user-name departed # 8. revoke AWS console
aws iam list-access-keys --user-name departed # then delete each key
echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) Offboarded [email protected]" >> ~/offboarding-log.txt
ビデオ会議
# macOS
lsof | grep "AppleCamera\|VDC" # check what owns the camera
pkill -f zoom.us && open -a zoom.us # restart Zoom
tccutil reset Camera # reset camera permissions
# Linux
pactl list short sources # list mics
pactl set-source-mute @DEFAULT_SOURCE@ 0 # unmute mic
Get-CimInstance Win32_SoundDevice | Select Name, Status
簡単な対処法: 音声が出ない場合は、OSのミュート設定と正しいデバイスが選択されていることを確認します。映像が出ない場合は、ほかの会議アプリを終了します。エコーが発生する場合は、ヘッドホンを使います。映像や音声が途切れる場合は、アップロード速度が3 Mbps以上必要です。
プリンター/周辺機器の問題
# macOS
lpstat -p -d && cancel -a # list printers, clear queue
sudo launchctl stop org.cups.cupsd && sudo launchctl start org.cups.cupsd
system_profiler SPUSBDataType # USB devices
# Linux
sudo systemctl restart cups # restart print system
lsusb && dmesg | tail -20 # USB diagnostics
Restart-Service Spooler -Force # restart print spooler
Get-PrintJob -PrinterName "OfficePrinter" | Remove-PrintJob # clear stuck jobs
セキュリティの基本
エンドポイント保護
# macOS
spctl --status # Gatekeeper
csrutil status # SIP
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
# Linux
sudo ufw enable && sudo ufw default deny incoming && sudo ufw default allow outgoing
Get-MpComputerStatus | Select AntivirusEnabled, RealTimeProtectionEnabled
Start-MpScan -ScanType QuickScan
Get-NetFirewallProfile | Select Name, Enabled
フィッシングへの対応
gam update user [email protected] password "$(openssl rand -base64 16)" changepassword on
gam user [email protected] signout # kill sessions
gam user [email protected] turnoff2sv # reset MFA
gam user [email protected] show tokens # check rogue OAuth apps
gam user [email protected] show forwarding # check attacker persistence
デバイスの紛失/盗難時の手順
- 直ちに -- MDMまたはFind My Macを使ってリモートワイプを実行します。
- 15分以内 -- パスワードをリセットし、セッションを終了させます(上記のSSOコマンドを参照)。
- 1時間以内 -- APIキーとシークレットをローテーションします:
gh auth refreshを実行し、AWSアクセスキーを削除します。 - 24時間以内 -- 不審なアクティビティがないかアクセスログを確認します。
関連スキル
- incident-management -- インシデント対応の体系化
- runbook-creation -- ドキュメント作成の基準