You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Thomas Wolf (Jira)" <ji...@apache.org> on 2021/10/16 20:10:00 UTC
[jira] [Resolved] (SSHD-1214) sshd login success using sshd 2.6.0
but failure with sshd 2.7.0
[ https://issues.apache.org/jira/browse/SSHD-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Wolf resolved SSHD-1214.
-------------------------------
Fix Version/s: (was: 2.6.0)
Assignee: Thomas Wolf
Resolution: Information Provided
> sshd login success using sshd 2.6.0 but failure with sshd 2.7.0
> ---------------------------------------------------------------
>
> Key: SSHD-1214
> URL: https://issues.apache.org/jira/browse/SSHD-1214
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 2.7.0
> Reporter: wei yao
> Assignee: Thomas Wolf
> Priority: Major
> Attachments: error.txt, ok.txt
>
>
> Hi, dear team.
> I'am facing one issue that the following code could login to one ssh server with sshd 2.6.0 but fail with 2.7.0. The configuration of sshd_config is:
> PermitRootLogin yes
> PasswordAuthentication yes
> UseDNS no
> Protocol 2
> LogLevel VERBOSE
> MaxAuthTries 3
> PubkeyAuthentication yes
> RSAAuthentication yes
> IgnoreRhosts yes
> RhostsRSAAuthentication no
> HostbasedAuthentication no
> PermitEmptyPasswords no
> PermitUserEnvironment no
> Ciphers aes128-ctr,aes192-ctr,aes256-ctr
> ClientAliveInterval 300
> ClientAliveCountMax 0
> Banner /etc/issue.net
> MACs hmac-sha2-256,hmac-sha2-512
> StrictModes yes
> AllowTcpForwarding no
> AllowAgentForwarding no
> GatewayPorts no
> PermitTunnel no
> KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
>
> the java code is following:
> {code:java}
> //
> public static String sshAndExecCommandThenGetResult(String ip, int port, String username, String password, String command){
> @Cleanup(value = "stop")
> SshClient client = SshClient.setUpDefaultClient();
> client.start();
> try (ClientSession session = client.connect(username, ip, port).verify(Duration.ofSeconds(20))
> .getSession()) {
> session.addPasswordIdentity(password); // for password-based authentication
> ClientSessionImpl c = (ClientSessionImpl)session;
> AuthFuture authFuture = session.auth();
> authFuture.verify(Duration.ofSeconds(10));
> return session.executeRemoteCommand(command);
> } catch (Exception e) {
> log.error(e.getMessage(), e);
> return "exception when exec command:" + e.getMessage();
> }
> {code}
> The debug log is in attachment.
> Please check. Thanks.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org