下载使用不同端口和私钥的文件远程服务器
我需要将文件从远程服务器下载到本地。 SSH 在非标准端口上运行,远程服务器需要私钥才能从本地连接到它。
我知道如何单独实现它:
对于非标准端口,它是:
scp -P 2222 [email protected]:/backup/file.zip /local/dir
对于使用私钥的服务器,它是:
scp -i private_key.pem [email protected]:/backup/file.zip /local/dir
但是如何下载需要连接到非默认端口并使用 pem 文件(私钥文件)的文件? 任何帮助将不胜感激。
谢谢
I need to download a file from a remote server to my local. The SSH is running on a non-standard port and the remote server required a private key to connect to it from local.
I know how to achieve it separately:
For non standard port it is:
scp -P 2222 [email protected]:/backup/file.zip /local/dir
For server using private key it is:
scp -i private_key.pem [email protected]:/backup/file.zip /local/dir
But how can I download a file that require connecting to a non-default port as well as uses pem file (private key file)?
Any help would be appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这对我有用。
This worked for me.