phpstorm 使用 ssh 报错连接服务器报错

2021-04-25 17:05:30 +08:00
 chinaliuhan

phpstorm 使用 ssh 报错连接服务器报错

PHPStorm 版本信息

phpstorm 2021.1.1

PHPStorm 报错提示信息

Cannot connect to remote host: net.schmizz.sshj.transport.TransportException: Socket closed

PHPStorm 错误日志




2021-04-24 04:05:46,772 [  24869]   WARN - om.intellij.ssh.impl.sshj.sshj - Failed to connect. Brief info: SSH connection to XXX-XXX@192.168.1.1:22
* With predefined preferred authentications: keyboard-interactive,password
* Compression methods from config: none
* With host key algorithms: ssh-ed25519, ecdsa-sha2-nistp521, ecdsa-sha2-nistp384, ecdsa-sha2-nistp256, rsa-sha2-512, rsa-sha2-256, ssh-rsa-cert-v01@openssh.com, ssh-dss-cert-v01@openssh.com, ssh-rsa, ssh-dss
* With OpenSSH-like host key verifier (knownHostsFile=[/Users/XXX/.ssh/known_hosts], strictHostKeyChecking=ASK, hashKnownHosts=false)
* With authentications allowed by the client: publickey, password, keyboard-interactive
* Connected
  => none (failure, new auth methods allowed by the server: password, publickey, gssapi-with-mic)
  => password (user auth exception: Broken transport; encountered EOF)
  => publickey /Users/XXX/.ssh/id_rsa (wrong passphrase or the key is corrupted) 
net.schmizz.sshj.userauth.UserAuthException: Authentication failed.
	at com.intellij.ssh.impl.sshj.SshjConnectionUtilKt.a(SshjConnectionUtil.kt:635)
	at com.intellij.ssh.impl.sshj.SshjConnectionUtilKt.setUpSessionForSshJ(SshjConnectionUtil.kt:493)
	at com.intellij.ssh.impl.SshConnection.b(SshConnection.kt:247)
	at com.intellij.ssh.impl.SshConnection.access$doSshjSshConnection(SshConnection.kt:30)
	at com.intellij.ssh.impl.SshConnection$createSshSessionForSshj$1.invoke(SshConnection.kt:243)
	at com.intellij.ssh.impl.SshConnection$createSshSessionForSshj$1.invoke(SshConnection.kt:30)
	at com.intellij.ssh.Ssh.wrapBlockingSshCall(ssh.kt:444)
	at com.intellij.ssh.Ssh.wrapBlockingSshCall$default(ssh.kt:426)
	at com.intellij.ssh.impl.SshConnection.d(SshConnection.kt:242)
	at com.intellij.ssh.impl.SshConnection.access$createSshSessionForSshj(SshConnection.kt:30)
	at com.intellij.ssh.impl.SshConnection$createSession$1.invoke(SshConnection.kt:205)
	at com.intellij.ssh.impl.SshConnection$createSession$1.invoke(SshConnection.kt:30)
	at com.intellij.ssh.Ssh.wrapBlockingSshCall(ssh.kt:444)
	at com.intellij.ssh.Ssh.wrapBlockingSshCall$default(ssh.kt:426)
	at com.intellij.ssh.impl.SshConnection.a(SshConnection.kt:200)
	at com.intellij.ssh.impl.SshConnection.access$createSession(SshConnection.kt:30)
	at com.intellij.ssh.impl.SshConnection$openChannel$1.invoke(SshConnection.kt:89)
	at com.intellij.ssh.impl.SshConnection$openChannel$1.invoke(SshConnection.kt:30)
	at com.intellij.ssh.Ssh.wrapBlockingSshCall(ssh.kt:444)
	at com.intellij.ssh.Ssh.wrapBlockingSshCall$default(ssh.kt:426)
	at com.intellij.ssh.impl.SshConnection.openChannel(SshConnection.kt:57)
	at com.intellij.ssh.SshConnectionService.sftp(SshConnectionService.kt:203)
	at com.intellij.ssh.SshConnectionService$failSafeSftp$1.invoke(SshConnectionService.kt:214)
	at com.intellij.ssh.SshConnectionService$failSafeSftp$1.invoke(SshConnectionService.kt:34)
	at com.intellij.ssh.impl.channels.FailSafeSftpChannel.supplyUnderlyingFileObject(FailSafeSftpChannel.kt:140)
	at com.intellij.ssh.impl.channels.FailSafeRemoteFileObject.exists(FailSafeRemoteFileObject.kt:226)
	at com.jetbrains.plugins.webDeployment.connections.platform.PlatformSftpFileSystem.getFileType(PlatformSftpFileSystem.java:103)
	at com.jetbrains.plugins.webDeployment.connections.platform.PlatformSftpFileObject.makeFileName(PlatformSftpFileObject.java:58)
	at com.jetbrains.plugins.webDeployment.connections.platform.PlatformSftpFileObject.<init>(PlatformSftpFileObject.java:49)
	at com.jetbrains.plugins.webDeployment.connections.platform.PlatformSftpFileObject.<init>(PlatformSftpFileObject.java:42)
	at com.jetbrains.plugins.webDeployment.connections.platform.PlatformSftpFileSystem.createFile(PlatformSftpFileSystem.java:47)
	at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:306)
	at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:279)
	at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:83)
	at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:63)
	at com.jetbrains.plugins.webDeployment.connections.SftpFileProviderProxy.findFile(SftpFileProviderProxy.java:74)
	at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:715)
	at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:647)
	at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionPool.lambda$createConnection$0(RemoteConnectionPool.java:262)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:265)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)
2021-04-23 17:01:12,649 [1253811]   INFO - shj.transport.random.JCERandom - Creating new SecureRandom. 
2021-04-23 17:01:12,866 [1254028]   INFO - z.sshj.transport.TransportImpl - Client identity string: SSH-2.0-SSHJ_0.31.0 
2021-04-23 17:01:12,929 [1254091]   INFO - z.sshj.transport.TransportImpl - Server identity string: SSH-2.0-OpenSSH_100.0 
2021-04-23 17:01:13,521 [1254683]   WARN - z.sshj.transport.TransportImpl - Dying because - Broken transport; encountered EOF 
net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
	at net.schmizz.sshj.transport.Reader.run(Reader.java:58)
2021-04-23 17:01:13,522 [1254684]   INFO - z.sshj.transport.TransportImpl - Disconnected - UNKNOWN 
2021-04-23 17:01:13,523 [1254685]   WARN - net.schmizz.concurrent.Promise - <<authenticated>> woke to: net.schmizz.sshj.userauth.UserAuthException: Broken transport; encountered EOF 


2063 次点击
所在节点    JetBrains
4 条回复
Mountain
2021-04-25 17:56:33 +08:00
画个重点
=> publickey /Users/XXX/.ssh/id_rsa (wrong passphrase or the key is corrupted)
net.schmizz.sshj.userauth.UserAuthException: Authentication failed.
chinaliuhan
2021-04-25 20:26:59 +08:00
@Mountain
直接使用 ssh 客户端连接是没问题的,比如:ssh xxx-111@192.168.1.1 没问题.
但是用 PHPstrom 就是不行.
Mountain
2021-04-26 18:01:32 +08:00
如果 /Users/XXX/.ssh/id_rsa 这个 key 是有效的,你把 Authentication type 改成 key pair 试试
CrazyBunQnQ
2022-04-01 10:06:51 +08:00
@chinaliuhan IDEA 遇到同样问题...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/773160

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX