Results 1 to 6 of 6
  1. #1

    * connection time out in windows server openssh server

    I installed an openssh server on windows server 2019.
    and then run a python script to connect them and run a list of commands. like this:
    HTML Code:
    list[150]
    for i in list:
        ssh.connect.run.command
        ssh.close
    After 50 connections, the ssh service was disconnected. and then I restart all of the services but yet still, can not connect to ssh. this is my checklist:
    • firewall: Disable
    • firewall inbound and outbound configured
    • OpenSSH status: Running
    • OpenSSH Authentication agent: Running


    all above service restarted. but can not connect to ssh service.

    ssh response error:
    Network Error: Connection Time out.

  2. #2
    Join Date
    Oct 2013
    Location
    Ottawa, Canada
    Posts
    96
    The OpenSSH server on Windows has a limit of 50 active sessions/connections. It might be fixed in newer versions.

    https://github.com/PowerShell/Win32-OpenSSH/issues/1096
    Last edited by DBAA; 10-06-2021 at 07:15 AM.

  3. #3
    Quote Originally Posted by DBAA View Post
    The OpenSSH server on Windows has a limit of 50 active sessions/connections.

    https://github.com/PowerShell/Win32-OpenSSH/issues/1096
    tnx too much to answer my topic.
    if you pay attention to my script, i will close the session in each command. and then i continue in the loop.
    openssh also supported 50 connections but in my case, the script does close communication at every step in the loop.
    like this:

    HTML Code:
    for command in list:
        ssh.open_connection.run(command)
        ssh.close_connection()
        continue
    So in my case, I have one connection. because in each command, it opens the connection and after executing the command, it closes the connection quickly and then opens another connection.

    so you think why? and what i do?

  4. #4
    Join Date
    Mar 2007
    Posts
    2,050
    More than likely the connection is not actually closed which is why you are running into the problem. You need to probably add a wait in there to give it time to properly close the connection as you may be opening them too quickly to be closed due to the way Windows handles connections. Though, the proper thing to do is open one connection and run all the commands you need then close it vs multiple connections like you are doing.

  5. #5
    Quote Originally Posted by HelpOps View Post
    More than likely the connection is not actually closed which is why you are running into the problem. You need to probably add a wait in there to give it time to properly close the connection as you may be opening them too quickly to be closed due to the way Windows handles connections. Though, the proper thing to do is open one connection and run all the commands you need then close it vs multiple connections like you are doing.
    tnx a lot for you :X

    after executing the script, it's been two days but still, I can't connect to the server using putty.
    i restarted all services but i cant connect ssh to the server.


    and i cant open one connection for all commands.
    because my app is an api. and the end user creates a loop for using my api for running commands in his server.

  6. #6
    Join Date
    Mar 2007
    Posts
    2,050
    What? If it is an API have them hit it over HTTPS not SSH, wrong protocol for what you are trying to do. Either way make sure you restart the sshd daemon and check if it is actually listening on port 22. If all else fails switch to Linux and all the problems will probably go away, if you are running a .NET app you can run it on Linux along with MSSQL server too. Then you will have more control over the entire stack if all else fails. You may also want to make sure you can curl to the port 22 to see if it is even open.

    Code:
    curl website.tld:22
    curl IPADDRESS:22
    
    #Response successful output
    SSH-2.X-OpenSSH_X.Xp1 Operating-System-Version
    curl: (56) Recv failure: Connection reset by peer
    Last edited by HelpOps; 10-06-2021 at 08:20 AM.

Similar Threads

  1. Server to Server connection in Windows Server
    By serverdetailer in forum Dedicated Server
    Replies: 26
    Last Post: 01-26-2008, 10:48 AM
  2. php_gd2.dll in windows server
    By herculesnetwork in forum Hosting Security and Technology
    Replies: 3
    Last Post: 10-10-2005, 02:47 PM
  3. Problems with cache in windows server 2003
    By fabiano in forum Web Hosting
    Replies: 0
    Last Post: 12-15-2004, 04:14 PM
  4. If PHP runs in windows server isnt it then better than linux server
    By Barti1987 in forum Programming Discussion
    Replies: 19
    Last Post: 10-08-2004, 04:57 AM
  5. Frontpage Problem in Windows Server
    By 2webhost in forum Hosting Security and Technology
    Replies: 3
    Last Post: 03-10-2004, 09:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •