V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
chinaliuhan
V2EX  ›  JetBrains

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

  •  
  •   chinaliuhan · 2021-04-25 17:05:30 +08:00 · 2315 次点击
    这是一个创建于 1299 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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 [email protected]: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, [email protected], [email protected], 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 
    
    
    
    第 1 条附言  ·  2021-04-25 20:26:33 +08:00
    直接使用 ssh 客户端连接是没问题的,比如:ssh [email protected] 没问题.

    但是用 PHPstrom 就是不行.
    4 条回复    2022-04-01 10:06:51 +08:00
    Mountain
        1
    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
        2
    chinaliuhan  
    OP
       2021-04-25 20:26:59 +08:00
    @Mountain
    直接使用 ssh 客户端连接是没问题的,比如:ssh [email protected] 没问题.
    但是用 PHPstrom 就是不行.
    Mountain
        3
    Mountain  
       2021-04-26 18:01:32 +08:00
    如果 /Users/XXX/.ssh/id_rsa 这个 key 是有效的,你把 Authentication type 改成 key pair 试试
    CrazyBunQnQ
        4
    CrazyBunQnQ  
       2022-04-01 10:06:51 +08:00
    @chinaliuhan IDEA 遇到同样问题...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5346 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 08:26 · PVG 16:26 · LAX 00:26 · JFK 03:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.