Results 1 to 6 of 6
-
10-06-2021, 06:20 AM #1Newbie
- Join Date
- Dec 2015
- Posts
- 23
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
- 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.
-
10-06-2021, 07:10 AM #2Junior Guru Wannabe
- 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/1096Last edited by DBAA; 10-06-2021 at 07:15 AM.
-
10-06-2021, 07:31 AM #3Newbie
- Join Date
- Dec 2015
- Posts
- 23
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 you think why? and what i do?
-
10-06-2021, 07:37 AM #4Web Hosting Master
- 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.
-
10-06-2021, 07:48 AM #5Newbie
- Join Date
- Dec 2015
- Posts
- 23
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.
-
10-06-2021, 08:14 AM #6Web Hosting Master
- 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
-
Server to Server connection in Windows Server
By serverdetailer in forum Dedicated ServerReplies: 26Last Post: 01-26-2008, 10:48 AM -
php_gd2.dll in windows server
By herculesnetwork in forum Hosting Security and TechnologyReplies: 3Last Post: 10-10-2005, 02:47 PM -
Problems with cache in windows server 2003
By fabiano in forum Web HostingReplies: 0Last Post: 12-15-2004, 04:14 PM -
If PHP runs in windows server isnt it then better than linux server
By Barti1987 in forum Programming DiscussionReplies: 19Last Post: 10-08-2004, 04:57 AM -
Frontpage Problem in Windows Server
By 2webhost in forum Hosting Security and TechnologyReplies: 3Last Post: 03-10-2004, 09:32 AM