[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Low cost] Wasabi object storage construction and operation service

[Low cost] Wasabi object storage construction and operation service

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “beSIM”

[Compatible with over 200 countries] Global eSIM “beSIM”

[Compatible with Chinese corporations] Chinese cloud / server construction, operation and maintenance

[Compatible with Chinese corporations] Chinese cloud / server construction, operation and maintenance

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

踏み台サーバ経由でWinSCPを使ってSCP接続する方法

インフラエンジニアの伊藤です。
最近のサーバ構成では、セキュリティレベルを上げるために踏み台サーバ経由でサーバに接続する環境が多くなってきています。

こんな感じの構成ですね。
SnapCrab_NoName_2016-1-19_11-0-39_No-00-min
エンドユーザはhttpでWebサーバのみにアクセスでき、サーバを設定する開発者等は踏み台サーバ経由で各サーバにSSHに接続出来る、という構成です。

コンテンツをアップロードする際にはSCPを使うことは多くあるかと思いますが、
踏み台サーバが存在する構成だと、対象のサーバにSSHやFTPで接続することが出来ません。

ということで、WinSCPで踏み台サーバ経由で接続する方法です。

セッション部分

WinSCPで起動した画面に入力する部分です。

winscp1

転送プロトコル SCP
ホスト名 ローカルIPアドレス
ポート番号 22
ユーザ名 踏み台経由で接続するサーバのユーザ名
パスワード 踏み台経由で接続するサーバのパスワード

トンネル

[設定] - [接続] - [トンネル]で、踏み台サーバへの接続設定を行います。

winscp2

SSHトンネルを経由して接続する チェックを入れる
ホスト名 踏み台サーバのホスト名orIPアドレス
ポート番号 22
ユーザ名 踏み台サーバに接続するユーザ名
パスワード 踏み台サーバに接続するパスワード
ローカルトンネルポート 自動選択
秘密鍵 踏み台サーバに接続するために必要な秘密鍵(.ppk)

(秘密鍵は、エンドのサーバが鍵接続の場合に必要になります)

認証

[設定] – [SSH] – [認証]で、認証条件の設定を行います。

中頃にある「認証条件」にて、以下の設定を行えばOKです。

  • 「エージェントの転送を許可する」にチェック
  • 先程の秘密鍵を選択する

接続する

上記の設定で接続した際には、秘密鍵のパスフレーズの入力が求められます。
踏み台サーバに対するログインと、そこからエンドのサーバにログインするので、2回求められます。

winscp3

これで無事繋がります。

踏み台サーバ経由の接続はちょっとだけ面倒ですので、是非この方法で接続してください!

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
5
読み込み中...
5 票, 平均: 1.00 / 15
76,236
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author