对于部署,我必须使用私钥连接到 SFTP
RemoteSftp.com:123
。
但是,我必须先使用 SSH 隧道访问
RemoteSftp.com
上的 GateSftp.com:456
以及其他用户名和其他私钥。
知道如何在 PhpStorm 中配置这种隧道吗?
据我所知,如果你可以使用
ssh remotesftp
连接到服务器,那么它应该可以在 jetbrains 中工作。
制作ssh的配置文件。在 linux/macOS 上是
~/.ssh/config
,对于 Windows 是%HOMEPATH%\.ssh\config
。
# The gate ssh server
Host gatesftp
User root
Port 456
HostName GateSftp.com
IdentityFile /path/to/gatesftp/private/key
# The deployment server
Host remotesftp
User root
Port 123
HostName RemoteSftp.com
IdentityFile /path/to/remotesftp/private/key
ProxyJump gatesftp
注意:当您执行代理跳转时,本地计算机的密钥适用于两者。你不需要让门服务器拿着钥匙
设置完成后,可以通过执行
ssh remotesftp
确认您已连接到服务器,然后您可以在jetbrains中执行以下步骤:
File
-> Settings
-> Tools
-> SSH Configurations
OpenSSH config and authentication agent
remotesftp
,端口:22
,用户名:root
(奇怪的是这个有效)