SSHConfigBuilder~/.ssh/config

OpenSSH クライアント設定ファイル (~/.ssh/config) 生成ツール

ホスト別名、ProxyJump踏み台接続、IdentityFile鍵バインド、ポート転送、セキュリティ強化設定を含む高品質な~/.ssh/configファイルを視覚的に生成します。

設定済みホスト
3
踏み台ジャンプ
2
ポート転送
1
構文検証ステータス
100% Valid OpenSSH

ホスト一覧・詳細設定

(3 configured)
Host bastion

ターミナルで入力する名前: ssh bastion

サーバーのドメイン名またはIPv4/IPv6アドレス。

SSHリモートログインユーザー名。

SSHリッスンポート (デフォルト: 22)。

~/.ssh/config(84 行)
# ==============================================================================
# OpenSSH Client Configuration (~/.ssh/config)
# Built with Interactive OpenSSH ~/.ssh/config File Builder
# File permissions required: chmod 600 ~/.ssh/config (Directory: chmod 700 ~/.ssh)
# ==============================================================================
 
# ------------------------------------------------------------------------------
# Public AWS EC2 Bastion Gateway in eu-central-1
# ------------------------------------------------------------------------------
Host bastion
HostName ec2-3-120-10-5.eu-central-1.compute.amazonaws.com
User ec2-user
IdentityFile ~/.ssh/aws-bastion.pem
IdentitiesOnly yes
AddKeysToAgent yes
PreferredAuthentications publickey
ServerAliveInterval 60
ServerAliveCountMax 3
TCPKeepAlive yes
ConnectTimeout 10
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 30m
ForwardAgent no
ForwardX11 no
StrictHostKeyChecking accept-new
Compression yes
 
# ------------------------------------------------------------------------------
# Internal production web cluster node (VPC subnet)
# ------------------------------------------------------------------------------
Host prod-app-01
HostName 10.0.10.45
User ubuntu
IdentityFile ~/.ssh/vpc-production.ed25519
IdentitiesOnly yes
AddKeysToAgent yes
PreferredAuthentications publickey
ProxyJump bastion
ServerAliveInterval 60
ServerAliveCountMax 3
TCPKeepAlive yes
ConnectTimeout 15
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 10m
ForwardAgent no
ForwardX11 no
StrictHostKeyChecking accept-new
 
# ------------------------------------------------------------------------------
# Local port tunnel to private Postgres RDS instance via Bastion
# ------------------------------------------------------------------------------
Host prod-db-tunnel
HostName 10.0.20.100
User ubuntu
IdentityFile ~/.ssh/vpc-production.ed25519
IdentitiesOnly yes
AddKeysToAgent yes
PreferredAuthentications publickey
ProxyJump bastion
LocalForward 127.0.0.1:5432 10.0.20.100:5432
ServerAliveInterval 30
ServerAliveCountMax 5
TCPKeepAlive yes
ConnectTimeout 10
ForwardAgent no
ForwardX11 no
StrictHostKeyChecking accept-new
Compression yes
 
# ------------------------------------------------------------------------------
# Global Wildcard Settings (Applies to all hosts)
# ------------------------------------------------------------------------------
Host *
ServerAliveInterval 60
ServerAliveCountMax 3
TCPKeepAlive yes
Compression yes
AddKeysToAgent yes
StrictHostKeyChecking accept-new
ForwardAgent no
ConnectTimeout 15
 

インストールとターミナル初期設定

1. ~/.ssh/config への保存と権限の厳格化
mkdir -p ~/.ssh && chmod 700 ~/.ssh cat << 'EOF' > ~/.ssh/config # [pasted configuration] EOF chmod 600 ~/.ssh/config
2. Test SSH connection with verbose debug logs
ssh -v bastion
OpenSSH Permissions Guard

OpenSSHは権限が緩い設定ファイルや鍵を無視します。以下を実行してください:
chmod 700 ~/.ssh && chmod 600 ~/.ssh/config ~/.ssh/id_*

ProxyJumpによる多段踏み台接続

踏み台サーバーを経由してプライベートVPC内のサーバーへ安全に接続するProxyJump設定をワンクリックで構築します。

IdentitiesOnlyによる鍵認証エラー防止

IdentitiesOnly yesを付与することで、ssh-agent内の無関係な秘密鍵が多数送信されて認証拒否されるエラーを防止します。

L/R/Dポート転送・SOCKS5トンネル設定

ローカル転送(LocalForward)、リモート転送(RemoteForward)、動的SOCKS5プロキシ(DynamicForward)を宣言的に構成できます。

技術リファレンス・アーキテクチャガイド

OpenSSH クライアント設定ファイル (~/.ssh/config) 生成ツール — 技術リファレンス

ホスト別名、ProxyJump踏み台接続、IdentityFile鍵バインド、ポート転送、セキュリティ強化設定を含む高品質な~/.ssh/configファイルを視覚的に生成します。

OpenSSH クライアント設定ファイル (~/.ssh/config) 生成ツール — 技術リファレンス — クライアントサイド完全ローカル実行アーキテクチャ図
OpenSSH クライアント設定ファイル (~/.ssh/config) 生成ツール — 技術リファレンス — クライアントサイド完全ローカル実行アーキテクチャ図

主要パラメータと設定項目

主要パラメータと設定項目
パラメータ型・単位説明初期値
ホスト別名 (Host)stringターミナルで入力する接続用の略称(例: ssh bastion, ssh prod-db)。prod-bastion
接続先 (HostName)string接続先サーバーの実際のIPアドレスまたはドメイン名。bastion.example.com
接続ユーザー名 (User)stringSSHログインで使用するリモートユーザー名。ubuntu
秘密鍵パス (IdentityFile)string認証に使用するローカル秘密鍵へのファイルパス(例: ~/.ssh/id_ed25519)。~/.ssh/id_ed25519

現場のベストプラクティス・実践Tips

ProxyJumpによる踏み台設定

OpenSSH 7.3以降で導入されたProxyJumpディレクティブを使用することで、ncコマンドを使わずに安全な踏み台多段接続を1行で定義できます。

IdentitiesOnlyの有効化

ssh-agentに多数の鍵が登録されていると、サーバー側で『Too many authentication failures』エラーが発生します。指定秘密鍵のみを使うよう制限します。

キープアライブによる切断防止

ServerAliveInterval 60 を指定することで定期的にキープアライブパケットを送信し、ルーターやNATによるタイムアウト切断を防ぎます。

よくある落とし穴とトラブルシューティング

⚠️Bad owner or permissions on ~/.ssh/config エラー

設定ファイルの権限が緩すぎる場合に発生します。『chmod 600 ~/.ssh/config』および『chmod 700 ~/.ssh』を実行して権限を修正してください。

⚠️踏み台経由の接続でタイムアウトする場合

踏み台サーバー自体にSSH接続できるか、また踏み台内部から目的のプライベートIPへルーティングが通っているかを確認してください。

よくある質問 (FAQ)

SSH設定ファイルはどこに配置すればよいですか?▼

Linux/macOSでは ~/.ssh/config、Windows環境では C:\Users\<ユーザー名>\.ssh\config に保存します。

ProxyJump(多段SSH接続)の仕組みは?▼

最初に踏み台サーバーと暗号化トンネルを確立し、そのトンネルを経由して内部ネットワークの宛先サーバーへ自動接続します。

現在推奨されるSSH暗号鍵の種類は何ですか?▼

Ed25519(ssh-keygen -t ed25519)が最も推奨されます。従来のRSAよりも強固で高速、鍵長も短く安全です。

生成された設定が外部サーバーに送信されることはありますか?▼

いいえ。すべての処理はブラウザのJavaScript内で完結し、サーバーへデータが送信されることは一切ありません。

関連ツール&ユーティリティ

全ツール一覧 →
ESLint Flat Config (eslint.config.mjs) 対話型ビルダー開発者ツール

TypeScript、React、Next.js、Vue、Prettier、カスタムプラグインルールを備えた最新のESLint 9+フラット設定ファイル(eslint.config.mjs / .js)を生成します。

ツールを開く→
Nginx サーバー設定&リバースプロキシ生成ツール開発者ツール

高性能 Nginx 設定ファイルを視覚的に生成。リバースプロキシ、SSL/TLS 暗号化設定、HTTP/2・HTTP/3、WebSocket プロキシ、gzip 圧縮、セキュリティヘッダーをブラウザ内で完全構築します。

ツールを開く→
Linux Logrotate 設定ファイル生成ツール(ログローテーション&圧縮)開発者ツール

/etc/logrotate.d/ のログローテーション設定ファイルを自動生成。日次/週次ローテーション、gzip圧縮、dateext日付拡張子、サイズ制限、postrotateスクリプトを完備。

ツールを開く→
Linux Supervisord (supervisord.conf) 設定ジェネレーター開発者ツール

自動再起動、プロセス並列数、ログ出力制御、環境変数、実行ユーザー権限を備えたSupervisord設定ブロックを瞬時に生成。

ツールを開く→
Traefik v3 動的構成ファイルジェネレーター開発者ツール

Traefik v3 の HTTP/TCP ルーター、ミドルウェア(stripPrefix、basicAuth、rateLimit)、サービス、Let's Encrypt TLS を YAML / TOML 形式で即時生成。

ツールを開く→
HAProxy ロードバランサー設定ジェネレーター開発者ツール

フロントエンドSSL終端、ラウンドロビンバックエンド、ヘルスチェック、ACL、レートリミットを備えた本番HAProxy 2.x/3.x設定を構築します。

ツールを開く→