简体   繁体   English

SFTP-从WinSCP到终端访问

[英]SFTP - From WinSCP to Terminal Access

I have been able to set up SSH access to my Google Cloud Platform VM via SFTP using WinSCP, but I now wish to do the same using another VM. 我已经能够使用WinSCP通过SFTP设置对我的Google Cloud Platform VM的SSH访问,但是现在我希望使用另一个VM进行相同的操作。

I have tried the ssh-keygen -t rsa , ssh-copy-id demo@198.51.100.0 method but always come up against the "Permission denied (public key)" error which from researching seems to be a pretty widespread issue with few reliable fixes (all the ones I tried didn't work). 我已经尝试过ssh-keygen -t rsa,ssh-copy-id demo@198.51.100.0方法,但是总是遇到“权限被拒绝(公共密钥)”错误,从研究看来这是一个非常普遍的问题,几乎没有可靠的修复(我尝试过的所有方法均无效)。

I used PuttyGen to create the public and private key, and inserted the public key onto the server just through GCP settings, adding it under the SSH settings for my instance. 我使用PuttyGen创建了公钥和私钥,然后仅通过GCP设置将公钥插入到服务器上,并将其添加到实例的SSH设置下。

I am just confused on what to do with the private key when simply trying to sftp through the terminal on a separate VM, as before I would load the private key into WinSCP settings. 当我试图通过单独的VM上的终端通过sftp进行操作时,我只是对如何处理私钥感到困惑,就像之前我将私钥加载到WinSCP设置中一样。 Is there a folder I need to place it in or? 是否需要放置一个文件夹?

Regarding your first issue of "Permission denied (public key)" error, please follow the troubleshooting in this link and this . 关于您的第一个问题“权限被拒绝(公共密钥)”错误,请按照此链接this中的疑难解答进行操作。

About your other question of "what to do with the private key when simply trying to sftp through the terminal", that depends on the settings of the specific the 3rd party SFTP tool you are using. 关于另一个问题“仅在尝试通过终端sftp时如何处理私钥”,这取决于所使用的特定第三方SFTP工具的设置。 To locate the locations of SSH key after generating them, please review this document . 要在生成SSH密钥后找到其位置,请查看此文档

Once you have added the public key in the VM, you would need to boot the VM for public key to take effect. 在VM中添加公钥后,您需要引导VM才能使公钥生效。 Try rebooting it and try 尝试重新启动并尝试

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “无法初始化 SFTP 协议。主机是否运行 SFTP 服务器?” 服务器需要“两个密码”时出现 WinSCP 错误 - "Cannot initialize SFTP protocol. Is the host running a SFTP server?" WinSCP error when the server requires "two passwords" 如何通过 FileZilla/WinScp 或 SSH 访问在 GCP 中通过市场产品部署创建的 VM 实例? - How to access an VM instance created from market product deployment in GCP via FileZilla/WinScp or SSH? 如何从Google Compute Engine访问外部SFTP - How to access an external SFTP from Google Compute Engine 无法从终端访问服务器SSH - Cannot access server SSH from terminal 在chrooted系统上使用JSch打开SFTP通道失败,并显示“无法发送通道请求”,但是WinSCP可以工作 - Opening SFTP channel with JSch on chrooted-system fails with “failed to send channel request”, but WinSCP works 无法使用 VB.NET 和 SSH.NET 连接到 SSH/SFTP 服务器 – 但 WinSCP 和 FileZilla 可以连接 - Cannot connect to SSH/SFTP server with VB.NET and SSH.NET – but WinSCP and FileZilla can connect 使用WinSCP到SFTP时,“未配置预期的主机密钥,请使用-hostkey开关” - “Expected host key was not configured, use -hostkey switch” when using WinSCP to SFTP 如何使用密码或SSH指纹WinSCP C#.NET程序集进行SFTP身份验证 - How to SFTP authenticate using password or SSH fingerprint WinSCP C# .NET assembly WinSCP .NET 库:无需指定 SSH 主机密钥指纹即可连接到 SFTP 服务器 - WinSCP .NET library: Connect to SFTP server without specifying SSH host key fingerprint 使用 WinSCP 命令将文件上传到 SFTP 时出现“主机密钥与配置的密钥不匹配” - “Host key does not match configured key” when uploading file to SFTP using WinSCP command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM