windowssshnetconf

SSH session automatically logged out


Setup:

Operation Performed: ssh admin@192.168.56.101 -p 2022

Result as seen in the Windows CLI:

ssh admin@192.168.56.101 -p 2022 admin@192.168.56.101's password: Connection to 192.168.56.101 closed.

Logs generated in Ubuntu: /var/log/syslog

......
audit user: admin/0 local authentication succeeded via Netconf from 192.168.56.1:62466 with ssh, member of groups: admin
audit user: admin/0 logged in via Netconf from 192.168.56.1:62466 with ssh using local authentication
audit user: admin/0 logged out <local> user

SSH Logs SSH verbose showed as follows.

ssh -vvv admin@192.168.56.101 -p 2022

admin@192.168.56.101's password:
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 52
debug1: Authentication succeeded (password).
Authenticated to 192.168.56.101 ([192.168.56.101]:2022).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Entering interactive session.
debug1: pledge: network
debug1: ENABLE_VIRTUAL_TERMINAL_INPUT is supported. Reading the VTSequence from console
debug3: This windows OS supports conpty
debug1: ENABLE_VIRTUAL_TERMINAL_PROCESSING is supported. Console supports the ansi parsing
debug3: Successfully set console output code page from:65001 to 65001
debug3: Successfully set console input code page from:437 to 65001
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug3: send packet: type 98
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 655360 rmax 65536
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug2: channel 0: output open -> drain
debug2: channel 0: chan_shutdown_read (i0 o1 sock -1 wfd 4 efd 6 [write])
debug2: channel 0: input open -> closed
debug3: channel 0: will not send data after close
debug2: channel 0: obuf empty
debug2: channel 0: chan_shutdown_write (i3 o1 sock -1 wfd 5 efd 6 [write])
debug2: channel 0: output drain -> closed
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug3: Successfully set console output code page from 65001 to 65001
debug3: Successfully set console input code page from 65001 to 437
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/6 sock -1 cc -1)

debug3: send packet: type 1
debug3: Successfully set console output code page from 65001 to 65001
debug3: Successfully set console input code page from 65001 to 437
Connection to 192.168.56.101 closed.
Transferred: sent 1808, received 844 bytes, in 0.0 seconds
Bytes per second: sent 154320.3, received 72038.9
debug1: Exit status -1
PS F:\1TB\P\workspace-IntelliJ-Erlang2\netconfClient> 

Expected Result I was expecting the SSH session to stay rather than being automatically logged out.

Please help me in debugging the issue.

When I run SSH in verbose mode, I see lot of logs in the CLI window wherein SSH is run. Are there any additional log files generated by OpenSSH in Windows similar to Ubuntu log /var/log/syslog?


Solution

  • Thanks to Predi, the resolution is

    ssh -s admin@192.168.56.101 -p 2022 Netconf
    

    PS: Since I could not mark his response as the answer, I am updating the query with the answer.