キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
169
閲覧回数
1
いいね!
1
コメント
JapanTAC_CSC
Level 7
Level 7

2024年4月15日 (初版)

TAC SR Collection
主な問題

Cisco Nexus 9000 シリーズで ftp などの password に @ が含まれたコマンドを 1 行で実行したとき、正しく動作しないことが報告されております。

事象例:ftp username : ftp_user , password : ftp@user  のとき

switch# copy startup-config ftp://ftp_user:ftp@user@<IPアドレスや hostname> vrf management
Enter destination filename: [switch-startup-config]
ftp: user@<IP アドレスや hostname>: host nor service provided, or not known 
原因

初めの @ 以降がサーバーの location として認識されるためです。

解決策

@ は予約文字のため、そのままの表記では記載できません。以下のように %40 などの URL エンコーディングをご利用頂くことで動作いたします。

動作例:ftp username : ftp_user , password : ftp@user  のとき

switch# copy startup-config ftp://ftp_user:ftp%40user@<IP アドレスや hostname> vrf management

備考
各製品の TAC SR Collection の一覧は、よくある質問と解決方法 (TAC SR Collection) から確認できます。

 

コメント
james-henderson
Level 1
Level 1

English Translation:

April 15, 2024 (First Edition)

TAC SR Collection Main Issue
It has been reported that commands containing passwords with @ in Cisco Nexus 9000 series, such as FTP, do not work correctly when executed in a single line.

Example Issue:
When the FTP username is ftp_user and the password is ftp@user:

 

 
switch# copy startup-config ftp://ftp_user:ftp@user@<IP address or hostname> vrf management
Enter destination filename: [switch-startup-config] ftp: user@<IP address or hostname>: host nor service provided, or not known

Cause
Anything after the first @ is recognized as the server location.

Solution
Since @ is a reserved character, it cannot be used as is. Use URL encoding such as %40 as shown below to make it work.

Example Solution:
When the FTP username is ftp_user and the password is ftp@user:

 

 
switch# copy startup-config ftp://ftp_user:ftp%40user@<IP address or hostname> vrf management

Notes
You can check the list of TAC SR Collection for each product from the FAQ and Solutions (TAC SR Collection).

My thoughts: at first I was horrified about the potential security problem here, then I realized it is just a matter of proper URL encoding. There are likely a variety of other characters that will cause problems if used in the password in this way. I would suggest URL encoding the password as well as any other user input before it is put into such a field if using automation to create any URL. The following library might be useful:


備考

最初はこの問題のセキュリティ上の懸念に驚かされましたが、正しいURLエンコーディングの問題であることに気付きました。パスワードに使用する他の文字も同様に問題を引き起こす可能性が高いため、URLを作成する際に自動化を使用する場合は、パスワードおよびその他のユーザー入力をURLエンコードすることをお勧めします。以下のライブラリが役立つかもしれません:


https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote_plus

Getting Started

検索バーにキーワード、フレーズ、または質問を入力し、お探しのものを見つけましょう

シスコ コミュニティをいち早く使いこなしていただけるよう役立つリンクをまとめました。みなさんのジャーニーがより良いものとなるようお手伝いします