6
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[sftp] SOCKS5プロキシを利用したSFTP接続

Last updated at Posted at 2014-09-02

謝辞

すごい時間をかけて調べた結果、Qiitaにたどり着きました。
ありがとうございました。

SOCKS5プロキシを利用したSSH接続

コマンド

connectを使う場合

$ sftp -o ProxyCommand="/usr/bin/connect -S [SOCKS5プロキシサーバー]:[ポート] %h %p" [user]@[sftpサーバー]

ncを使う場合

$ sftp -o ProxyCommand="/usr/bin/nc -X 5 -x [SOCKS5プロキシサーバー]:[ポート] %h %p" [user]@[sftpサーバー]

公開鍵認証を行う場合
(事前に鍵ペアを生成し、公開鍵をサーバーに登録してもらう必要があります)

$ sftp -o ProxyCommand="/usr/bin/nc -X 5 -x [SOCKS5プロキシサーバー]:[ポート] %h %p" -o IdentityFile="[秘密鍵のパス]" [user]@[sftpサーバー]

参考

SSH_CONFIG (5)

6
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?