您好,我正在尝试连接到Windows vps服务器,但我收到此错误消息:
Traceback (most recent call last):
File "C:\Users\uwu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "C:\Users\win\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
raise err
File "C:\Users\uwu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
然后:
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x03AFF2D0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
During handling of the above exception, another exception occurred:
我的代码:
import winrm
s = winrm.Session('127.0.0.1', auth=('administrator', 'Something'))
r = s.run_cmd('ipconfig', ['/all'])
r.status_code
r.std_out
r.std_err
P.S 0:我试图连接到Windows Sever 2012 P.S 1:如果有连击方式连接到rm服务器,请与我共享。