hengboy opened a new issue, #508:
URL: https://github.com/apache/mina-sshd/issues/508

   ### Version
   
   2.12.2
   
   ### Bug description
   
   ```java
   try (SshClient client = SshClient.setUpDefaultClient()) {
               client.start();
               clientSession = client.connect(config.getUsername(), 
config.getServerIp(), config.getSshPort()).verify().getSession();
               boolean result = clientSession.auth().verify().await();
               if (!result) {
                   throw new AgentException("Remote server ssh login failed.");
               } else {
                   log.info("Connection to the remote server [{}] is 
successful.", config.getServerIp());
                   // Local and remote port number binding forwarding
                   this.portForwardingTracker = 
clientSession.createLocalPortForwardingTracker(new 
SshdSocketAddress(FORWARD_LOCAL_IP, config.getLocalPort()),
                           new SshdSocketAddress(config.getForwardTargetIp(), 
config.getForwardTargetPort()));
                   log.info("Port forwarding binding is completed, local port : 
{}, forward IP: {}, forward port : {}",
                           config.getLocalPort(), config.getForwardTargetIp(), 
config.getForwardTargetPort());
               }
           } catch (Exception e) {
               throw new AgentException("Remote server port number forwarding 
failed.", e);
           }
   ```
   
   
   
   ### Actual behavior
   
   sshd logs
   ```
   May 27 06:37:35 node1 sshd[1367281]: Accepted publickey for root from 
xxx.xxx.xx port 51881 ssh2: ED25519 SHA256:k0velrxirD8HY9rq/GMBqoBI......
   May 27 06:37:35 node1 sshd[1367281]: pam_unix(sshd:session): session opened 
for user root(uid=0) by (uid=0)
   May 27 06:37:35 node1 systemd-logind[743]: New session 244 of user root.
   May 27 06:37:35 node1 sshd[1367281]: pam_unix(sshd:session): session closed 
for user root
   May 27 06:37:35 node1 systemd-logind[743]: Session 244 logged out. Waiting 
for processes to exit.
   May 27 06:37:35 node1 systemd-logind[743]: Removed session 244.
   ```
   
   ### Expected behavior
   
   If the close method is not executed, the forwarding will continue.
   
   ### Relevant log output
   
   _No response_
   
   ### Other information
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to