Skip to content

Instantly share code, notes, and snippets.

@keijiro
Created November 5, 2012 07:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keijiro/4015735 to your computer and use it in GitHub Desktop.
Save keijiro/4015735 to your computer and use it in GitHub Desktop.
curl で FTP over TLS/SSL なサーバーへアクセスする

たまにセキュリティの都合上云々で FTP over TLS/SSL を使わざるを得ない状況に追い込まれることがあります。そういったレアな状況のためにわざわざ特殊な FTP クライアントをインストールするのは面倒です。こういった時に curl を使うと大変楽です(curl ぐらいは入れておきましょう)。

こんな感じにします。

curl -u username:password --ftp-ssl ftp://example.com

ファイルを取得するときには、こんな感じで出力ファイルを指定します。

curl -u username:password --ftp-ssl -o filename ftp://example.com/filename

もし CA certs が云々と警告された場合は、次のように -k オプションでねじ伏せることができます。

curl -u username:password --ftp-ssl -k ftp://example.com

以上。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment