chinaliuhan
V2EX  ›  JetBrains

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

  •  
  •   chinaliuhan · Apr 25, 2021 · 3580 views
    This topic created in 1861 days ago, the information mentioned may be changed or developed.

    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 
    
    
    
    Supplement 1  ·  Apr 25, 2021
    直接使用 ssh 客户端连接是没问题的,比如:ssh [email protected] 没问题.

    但是用 PHPstrom 就是不行.
    4 replies    2022-04-01 10:06:51 +08:00
    Mountain
        1
    Mountain  
       Apr 25, 2021
    画个重点
    => publickey /Users/XXX/.ssh/id_rsa (wrong passphrase or the key is corrupted)
    net.schmizz.sshj.userauth.UserAuthException: Authentication failed.
    chinaliuhan
        2
    chinaliuhan  
    OP
       Apr 25, 2021
    @Mountain
    直接使用 ssh 客户端连接是没问题的,比如:ssh [email protected] 没问题.
    但是用 PHPstrom 就是不行.
    Mountain
        3
    Mountain  
       Apr 26, 2021
    如果 /Users/XXX/.ssh/id_rsa 这个 key 是有效的,你把 Authentication type 改成 key pair 试试
    CrazyBunQnQ
        4
    CrazyBunQnQ  
       Apr 1, 2022
    @chinaliuhan IDEA 遇到同样问题...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2760 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 06:50 · PVG 14:50 · LAX 23:50 · JFK 02:50
    ♥ Do have faith in what you're doing.