SFTP-сервер на Python с Paramiko не разрешает SFTP-соединенияPython

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 SFTP-сервер на Python с Paramiko не разрешает SFTP-соединения

Сообщение Anonymous »

Я переписал вопрос, потому что он не поместился ниже.
Я пытаюсь использовать библиотеку paramiko на Python для настройки SFTP-сервера.
Я начинаю определять ROOT_FOLDER для пути к желаемой папке.
Затем я расширяю paramiko.SFTPServerInteface:

Код: Выделить всё

class SFTPServer(paramiko.SFTPServerInterface):
def __init__(self, server: paramiko.ServerInterface, *args, **kwargs):
super().__init__(server)
self.root_folder = ROOT_FOLDER

def _resolve_path(self, path):
safe_path = os.path.normpath(os.path.join(self.root_folder, path.lstrip('\\')))
if not safe_path.startswith(self.root_folder):
raise IOError("Access denied.")  # Blocca accesso esterno a ROOT_FOLDER
return safe_path

def list_folder(self, path):
logging.debug("Listing folder files.")
full_path = self._resolve_path(path)
files = os.listdir(full_path)
return [paramiko.SFTPAttributes.from_stat(os.stat(os.path.join(full_path, f))) for f in files]

def stat(self, path):
full_path = self._resolve_path(path)
return paramiko.SFTPAttributes.from_stat(os.stat(full_path))

def open(self, path, flags, attr):
full_path = self._resolve_path(path)
mode = 'rb' if flags & os.O_RDONLY else 'wb'
return open(full_path, mode)

def remove(self, path):
full_path = self._resolve_path(path)
os.remove(full_path)
А затем paramiko.ServerInterface:

Код: Выделить всё

class SSHServer(paramiko.ServerInterface):
def __init__(self):
super().__init__()
self.event = threading.Event()

def check_auth_password(self, username, password):
if authenticate_user(username, password=password):
logging.debug(f"User {username} authenticated by password.")
return paramiko.AUTH_SUCCESSFUL
else:
logging.debug(f"Failed password authentication for user {username}.")
return paramiko.AUTH_FAILED

def check_auth_publickey(self, username, key):
public_key = key.get_base64()
if authenticate_user(username, public_key=public_key):
logging.debug(f"User {username} authenticated by public key.")
return paramiko.AUTH_SUCCESSFUL
else:
logging.debug(f"Failed public key authentication for user {username}.")
return paramiko.AUTH_FAILED

def check_channel_request(self, kind, chanid):
logging.debug(f"Channel request type: {kind}")
if kind == 'session':
return paramiko.OPEN_SUCCEEDED
else:
logging.debug(f"Channel type not supported: {kind}")
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED

def check_channel_subsystem_request(self, channel, name):
logging.debug(f"Channel request type (subsystem): {name}")
if name == 'sftp':
paramiko.SFTPServer(channel, 'sftp', self, SFTPServer)
return paramiko.OPEN_SUCCEEDED
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED

def check_channel_pty_request(self, channel, term, width, height, pixelwidth, pixelheight, modes):
return True

def check_channel_shell_request(self, channel):
self.event.set()
return True

def check_channel_exec_request(self, channel, command):
channel.send(b"Esecuzione del comando: " + command)
channel.send_exit_status(0)
return True
Я не знаю, правильно ли обрабатываются запросы оболочки, pty и exec.
В этой функции я обрабатываю клиентское соединение, но это не так. Не знаю, пришлось ли мне писать "transport.set_subsystem_handler" или строки с комментариями:

Код: Выделить всё

def handle_client(client_socket: socket.socket, host_key: paramiko.RSAKey):
try:

transport = paramiko.Transport(client_socket)
transport.add_server_key(host_key)

ssh_server = SSHServer()

try:
transport.start_server(server=ssh_server)
except paramiko.SSHException as e:
logging.error(f"SSH negotiation failed: {e}")
return

channel = transport.accept(40)
if channel is None:
logging.error("No channel found")
return

logging.info("Client authenticated.")
logging.debug("Starting SFTP session.")

#sftp_server = paramiko.SFTPServer(transport, sftp_si=SFTPServer(ssh_server, ROOT_FOLDER))
#sftp_server.start()

transport.set_subsystem_handler('sftp', paramiko.SFTPServer, SFTPServer)

while not channel.closed:
time.sleep(1)

except paramiko.SSHException as e:
logging.error(f"SSH exception: {e}")
except Exception as e:
logging.error(f"Error handling client: {e}")
finally:
logging.debug("Closing channel.")
if channel != None:
channel.close()
Затем, чтобы запустить сервер, я использую эту функцию:

Код: Выделить всё

def start_sftp_server():
logging.info("Starting SFTP server...")

host_key = paramiko.RSAKey.generate(2048)

server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.bind(('localhost', 2222))
server_socket.listen(100)

client_socket, addr = server_socket.accept()

transport = paramiko.Transport(client_socket)
transport.add_server_key(host_key)

server = SSHServer()

transport.start_server(server=server)

channel = transport.accept()
logging.info("SFTP Server started.")
#transport.set_subsystem_handler('sftp', paramiko.SFTPServer(channel, 'sftp', server, SFTPServer))
while transport.is_active():
pass
Когда я пытаюсь подключиться к серверу с помощью такого программного обеспечения, как WinSCP или FileZilla, сеанс запускается, но он остается зависшим, я не вижу файлов, и время ожидания клиента истекает.
Вот логи парамико:

Код: Выделить всё

DEB [20241106-11:13:12.316] thr=1   paramiko.transport: starting thread (server mode): 0xfe318c80
DEB [20241106-11:13:12.317] thr=1   paramiko.transport: Local version/idstring: SSH-2.0-paramiko_3.5.0
DEB [20241106-11:13:12.354] thr=1   paramiko.transport: Remote version/idstring: SSH-2.0-WinSCP_release_6.3.5
INF [20241106-11:13:12.355] thr=1   paramiko.transport: Connected (version 2.0, client WinSCP_release_6.3.5)
DEB [20241106-11:13:12.359] thr=1   paramiko.transport: === Key exchange possibilities ===
DEB [20241106-11:13:12.359] thr=1   paramiko.transport: kex algos: [email protected], curve448-sha512, curve25519-sha256, [email protected], ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group-exchange-sha256, diffie-hellman-group-exchange-sha1, diffie-hellman-group18-sha512, diffie-hellman-group17-sha512, diffie-hellman-group16-sha512, diffie-hellman-group15-sha512, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1, rsa2048-sha256, rsa1024-sha1, diffie-hellman-group1-sha1, ext-info-c, [email protected]
DEB [20241106-11:13:12.360] thr=1   paramiko.transport: server key: rsa-sha2-512, rsa-sha2-256, ssh-rsa, ssh-ed448, ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, ssh-dss
DEB [20241106-11:13:12.361] thr=1   paramiko.transport: client encrypt: aes256-ctr, aes256-cbc, [email protected], aes192-ctr, aes192-cbc, aes128-ctr, aes128-cbc, [email protected], [email protected], [email protected], 3des-ctr, 3des-cbc, blowfish-ctr, blowfish-cbc, arcfour256, arcfour128
DEB [20241106-11:13:12.361] thr=1   paramiko.transport: server encrypt: aes256-ctr, aes256-cbc, [email protected], aes192-ctr, aes192-cbc, aes128-ctr, aes128-cbc, [email protected], [email protected], [email protected], 3des-ctr, 3des-cbc, blowfish-ctr, blowfish-cbc, arcfour256, arcfour128
DEB [20241106-11:13:12.362] thr=1   paramiko.transport: client mac: hmac-sha2-256, hmac-sha2-512, hmac-sha1, hmac-sha1-96, hmac-md5, [email protected], [email protected], [email protected], [email protected], [email protected]
DEB [20241106-11:13:12.362] thr=1   paramiko.transport: server mac:  hmac-sha2-256, hmac-sha2-512, hmac-sha1, hmac-sha1-96, hmac-md5, [email protected], [email protected], [email protected], [email protected], [email protected]
DEB [20241106-11:13:12.363] thr=1   paramiko.transport: client compress: none, zlib, [email protected]
DEB [20241106-11:13:12.363] thr=1   paramiko.transport: server compress: none, zlib, [email protected]
DEB [20241106-11:13:12.364] thr=1   paramiko.transport: client lang: 
DEB [20241106-11:13:12.364] thr=1   paramiko.transport: server lang: 
DEB [20241106-11:13:12.364] thr=1   paramiko.transport: kex follows: False
DEB [20241106-11:13:12.365] thr=1   paramiko.transport: === Key exchange agreements ===
DEB [20241106-11:13:12.365] thr=1   paramiko.transport: Strict kex mode: True
DEB [20241106-11:13:12.366] thr=1   paramiko.transport: Kex: [email protected]
DEB [20241106-11:13:12.366] thr=1   paramiko.transport: HostKey: rsa-sha2-512
DEB [20241106-11:13:12.367] thr=1   paramiko.transport: Cipher: aes256-ctr
DEB [20241106-11:13:12.367] thr=1   paramiko.transport: MAC: hmac-sha2-256
DEB [20241106-11:13:12.367] thr=1   paramiko.transport: Compression: none
DEB [20241106-11:13:12.368] thr=1   paramiko.transport: === End of kex handshake ===
DEB [20241106-11:13:12.377] thr=1   paramiko.transport: Resetting outbound seqno after NEWKEYS due to strict mode
DEB [20241106-11:13:12.378] thr=1   paramiko.transport: kex engine KexCurve25519 specified hash_algo 
DEB [20241106-11:13:13.483] thr=1   paramiko.transport: Switch to new keys ...
DEB [20241106-11:13:13.484] thr=1   paramiko.transport: Resetting inbound seqno after NEWKEYS due to strict mode
DEB [20241106-11:13:13.512] thr=1   paramiko.transport: Auth request (type=none) service=ssh-connection, username=MagoLione
INF [20241106-11:13:13.512] thr=1   paramiko.transport: Auth rejected (none).
DEB [20241106-11:13:13.543] thr=1   paramiko.transport: Auth request (type=password) service=ssh-connection, username=MagoLione
INF [20241106-11:13:14.109] thr=1   paramiko.transport: Auth granted (password).
DEB [20241106-11:13:14.112] thr=1   paramiko.transport: [chan 0] Max packet in: 32768 bytes
DEB [20241106-11:13:14.112] thr=1   paramiko.transport: [chan 0] Max packet out: 16384 bytes
DEB [20241106-11:13:14.113] thr=1   paramiko.transport: Secsh channel 0 (session) opened.
DEB [20241106-11:13:14.113] thr=1   paramiko.transport: [chan 0] Unhandled channel request "[email protected]"
DEB [20241106-11:13:32.274] thr=1   paramiko.transport: [chan 0] EOF received (0)
DEB [20241106-11:13:32.796] thr=1   paramiko.transport: EOF in transport thread
Вот журналы WinSCP:

Код: Выделить всё

. 2024-11-06 11:13:11.229 --------------------------------------------------------------------------
. 2024-11-06 11:13:11.229 WinSCP Versione 6.3.5 (Build 14991 2024-09-10) (OS 10.0.22621 – Windows 10 Home)
. 2024-11-06 11:13:11.229 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2024-11-06 11:13:11.231 Log level: Debug 2
. 2024-11-06 11:13:11.231 Local account: PC-MAGOLIONE\simon
. 2024-11-06 11:13:11.231 Working directory: C:\Program Files (x86)\WinSCP
. 2024-11-06 11:13:11.231 Process ID: 5600
. 2024-11-06 11:13:11.231 Ancestor processes: explorer, ...
. 2024-11-06 11:13:11.232 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe"
. 2024-11-06 11:13:11.232 Time zone: Current: GMT+1, Standard: GMT+1 (ora solare Europa occidentale), DST: GMT+2 (ora legale Europa occidentale), DST Start: 31/03/2024, DST End: 27/10/2024
. 2024-11-06 11:13:11.232 Login time: mercoledì 6 novembre 2024 11:13:11
. 2024-11-06 11:13:11.232 --------------------------------------------------------------------------
. 2024-11-06 11:13:11.232 Session name: MagoLione@localhost (Site)
. 2024-11-06 11:13:11.232 Host name: localhost (Port: 2222)
. 2024-11-06 11:13:11.232 User name: MagoLione (Password: Yes, Key file: No, Passphrase: No)
. 2024-11-06 11:13:11.232 Tunnel: No
. 2024-11-06 11:13:11.232 Transfer Protocol: SFTP (SCP)
. 2024-11-06 11:13:11.232 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2024-11-06 11:13:11.232 Disable Nagle: No
. 2024-11-06 11:13:11.232 Proxy: None
. 2024-11-06 11:13:11.232 Send buffer: 262144
. 2024-11-06 11:13:11.232 Compression: No
. 2024-11-06 11:13:11.232 Bypass authentication: No
. 2024-11-06 11:13:11.232 Try agent: Yes; Agent forwarding: No; KI: Yes; GSSAPI: Yes
. 2024-11-06 11:13:11.232 GSSAPI: KEX: No; Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2024-11-06 11:13:11.232 Ciphers: aes,chacha20,aesgcm,3des,WARN,des,blowfish,arcfour; Ssh2DES: No
.  2024-11-06 11:13:11.232 KEX: ntru-curve25519,ecdh,dh-gex-sha1,dh-group18-sha512,dh-group17-sha512,dh-group16-sha512,dh-group15-sha512,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2024-11-06 11:13:11.233 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2024-11-06 11:13:11.233 Simple channel: Yes
. 2024-11-06 11:13:11.233 Return code variable: Autodetect; Lookup user groups: Auto
. 2024-11-06 11:13:11.233 Shell: default
. 2024-11-06 11:13:11.233 EOL: LF, UTF: Auto
. 2024-11-06 11:13:11.233 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2024-11-06 11:13:11.233 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2024-11-06 11:13:11.233 SFTP Bugs: Auto,Auto
. 2024-11-06 11:13:11.233 SFTP Server: default
. 2024-11-06 11:13:11.233 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2024-11-06 11:13:11.233 Cache directory changes: Yes, Permanent: Yes
. 2024-11-06 11:13:11.233 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2024-11-06 11:13:11.233 DST mode: Unix
. 2024-11-06 11:13:11.233 --------------------------------------------------------------------------
. 2024-11-06 11:13:11.309 Looking up host "localhost" for SSH connection
. 2024-11-06 11:13:11.310 Connecting to ::1 port 2222
. 2024-11-06 11:13:12.315 Failed to connect to ::1: Network error: Connection refused
. 2024-11-06 11:13:12.315 Connecting to 127.0.0.1 port 2222
. 2024-11-06 11:13:12.316 Connected to 127.0.0.1
. 2024-11-06 11:13:12.316 Selecting events 63 for socket 3468
. 2024-11-06 11:13:12.354 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:12.354 Looking for incoming data
. 2024-11-06 11:13:12.354 Looking for network events
. 2024-11-06 11:13:12.354 We claim version: SSH-2.0-WinSCP_release_6.3.5
. 2024-11-06 11:13:12.354 Detected network event
. 2024-11-06 11:13:12.354 Enumerating network events for socket 3468
. 2024-11-06 11:13:12.354 Enumerated 19 network events making 19 cumulative events for socket 3468
. 2024-11-06 11:13:12.354 Handling network write event on socket 3468 with error 0
. 2024-11-06 11:13:12.354 Handling network connect event on socket 3468 with error 0
. 2024-11-06 11:13:12.354 Connected to 127.0.0.1
. 2024-11-06 11:13:12.354 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:12.354 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:12.354 Looking for incoming data
. 2024-11-06 11:13:12.354 Looking for network events
. 2024-11-06 11:13:12.354 Remote version: SSH-2.0-paramiko_3.5.0
. 2024-11-06 11:13:12.354 Using SSH protocol version 2
. 2024-11-06 11:13:12.357 Have a known host key of type rsa2
. 2024-11-06 11:13:12.358 Detected network event
. 2024-11-06 11:13:12.358 Enumerating network events for socket 3468
. 2024-11-06 11:13:12.358 Enumerated 1 network events making 1 cumulative events for socket 3468
. 2024-11-06 11:13:12.358 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:12.358 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:12.358 Looking for incoming data
. 2024-11-06 11:13:12.358 Looking for network events
. 2024-11-06 11:13:12.359 Enabling strict key exchange semantics
. 2024-11-06 11:13:12.359 Doing ECDH key exchange with curve Curve25519, using hash SHA-256
. 2024-11-06 11:13:12.377 Detected network event
. 2024-11-06 11:13:12.377 Enumerating network events for socket 3468
. 2024-11-06 11:13:12.377 Enumerated 1 network events making 1 cumulative events for socket 3468
. 2024-11-06 11:13:12.377 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:12.377 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:12.377 Looking for incoming data
. 2024-11-06 11:13:12.377 Looking for network events
. 2024-11-06 11:13:12.426 Host key fingerprint is:
. 2024-11-06 11:13:12.426 ssh-rsa 2048 SHA256:pv27N8+mna4nUWcGs/yVkWOEH4KGSpTDIiKDJ0Qhtj8
.  2024-11-06 11:13:12.426 Verifying host key rsa2 0x10001,0xc9cf42a677d2ea7d 97ace0b0c277c28e ce6a6f42d4f85c45 26354b6c428eb5d1 82ba452f6ad6cbb6 a9ed3f13f42c69a6 25571fc0a9da154f 9fb9e171fd85dfaa 01bb8bbf3e2f74d8 4524489f62c31657 733d6295fd403bc0 85c1cd39ca0033e2 d9619a62911b6d30 50fdbafcf6da63b3 5f85dc2f837ea2b6 b2b279f65360e4d9 4eb25f0e2aab1061 780bc7bcdf443f87 82fce2ff4fc697fa 84155b2269d69f8b a11387f3b82c9b9a 0170e676848ee383 11e64b38168e366a dc565635ded90669 f7a6be83a4935b74 2f7bd7f75ff5392c 4d39f672f77aab89 915689f9f0629d4e fbf8630e32ffe125 d595470699d5145e e2cc961432d76c02 d7ccc106e33dac1d  with fingerprints ssh-rsa 2048 SHA256:pv27N8+mna4nUWcGs/yVkWOEH4KGSpTDIiKDJ0Qhtj8, ssh-rsa 2048 ce:1c:1f:cf:22:40:3f:cd:6b:e1:60:ed:fd:4a:d4:df
. 2024-11-06 11:13:12.448 Host key does not match cached key 0x10001,0xd4bb11edf88316dd b5765e6bb505d08d 26c0fb695ed38d3f e72fb6ce0c000608 849904e547ccc926 fda9ca3e9d1a9f48 94a9ba8643b83e8f 79d09f84f9c865ff ee14b4ac130807ab bd941e48737284ba c657a70ea3b3e9a0 a80a4c99cbef3808 34c6abd0596b691a aa5ebe0af27f32db 4f07742f3b3bfdad 709b234c2003d251 480fbcaf44f4709c f002284d1e2d73da f71b3bd906c58299 9b45d9c6d49f3740 be7e4513a2abec8f 6ba100b4f0447104 c812762ccbae111b 74319e6114cee61d f94a356c5b5404aa 53fbea86e4bac3d4 609a10ba56547546 cb8c9ce6da183daf 2b7016dfb4ab458f d89a8aadb43155dc 03549061bb71bb21 2968882fc8038c95
. 2024-11-06 11:13:12.448 Asking user:
. 2024-11-06 11:13:12.448 **Attenzione: potenziale violazione della sicurezza!**
. 2024-11-06 11:13:12.448
. 2024-11-06 11:13:12.448 La chiave host non corrisponde a quella memorizzata nella cache da WinSCP per questo server:
. 2024-11-06 11:13:12.448 localhost (porta 2222)
. 2024-11-06 11:13:12.448
. 2024-11-06 11:13:12.448 Ciò significa che l'amministratore del server ha modificato la chiave host, o ti sei effettivamente connesso ad un altro computer fingendo di essere il server.
. 2024-11-06 11:13:12.448
. 2024-11-06 11:13:12.448     La firma digitale della chiave rsa2 è:
. 2024-11-06 11:13:12.448     ssh-rsa 2048 pv27N8+mna4nUWcGs/yVkWOEH4KGSpTDIiKDJ0Qhtj8
. 2024-11-06 11:13:12.448
. 2024-11-06 11:13:12.448 Se ti aspettavi questo cambiamento, fidati della nuova chiave e vuoi continuare a connetterti al server, seleziona Aggiorna per aggiornare la cache, oppure seleziona Aggiungi per aggiungere la nuova chiave alla cache mantenendo quelle vecchie.
. 2024-11-06 11:13:12.449 Se vuoi continuare a connetterti ma senza aggiornare la cache, seleziona Connetti una volta.
. 2024-11-06 11:13:12.449 Se vuoi abbandonare completamente la connessione, seleziona Annulla per annullare. Selezionare Annulla è l'UNICA scelta sicura garantita. ()
. 2024-11-06 11:13:13.481 Answer: Yes
. 2024-11-06 11:13:13.482 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] outbound encryption
. 2024-11-06 11:13:13.482 Initialised HMAC-SHA-256 outbound MAC algorithm
. 2024-11-06 11:13:13.482 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] inbound encryption
. 2024-11-06 11:13:13.482 Initialised HMAC-SHA-256 inbound MAC algorithm
. 2024-11-06 11:13:13.482 Detected network event
. 2024-11-06 11:13:13.482 Enumerating network events for socket 3468
. 2024-11-06 11:13:13.482 Enumerated 1 network events making 1 cumulative events for socket 3468
. 2024-11-06 11:13:13.482 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:13.482 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:13.482 Looking for incoming data
. 2024-11-06 11:13:13.482 Looking for network events
. 2024-11-06 11:13:13.485 Detected network event
. 2024-11-06 11:13:13.485 Enumerating network events for socket 3468
. 2024-11-06 11:13:13.485 Enumerated 1 network events making 1 cumulative events for socket 3468
. 2024-11-06 11:13:13.485 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:13.485 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:13.485 Looking for incoming data
. 2024-11-06 11:13:13.485 Looking for network events
! 2024-11-06 11:13:13.487 Using username "MagoLione".
. 2024-11-06 11:13:13.513 Detected network event
. 2024-11-06 11:13:13.513 Enumerating network events for socket 3468
. 2024-11-06 11:13:13.513 Enumerated 1 network events making 1 cumulative events for socket 3468
. 2024-11-06 11:13:13.513 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:13.513 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:13.513 Looking for incoming data
. 2024-11-06 11:13:13.513 Looking for network events
. 2024-11-06 11:13:13.513 Server offered these authentication methods: password
.  2024-11-06 11:13:13.513 Prompt (password, "SSH password", , "&Password: ")
. 2024-11-06 11:13:13.513 Using stored password.
. 2024-11-06 11:13:13.543 Sent password
. 2024-11-06 11:13:14.110 Detected network event
. 2024-11-06 11:13:14.110 Enumerating network events for socket 3468
. 2024-11-06 11:13:14.110 Enumerated 1 network events making 1 cumulative events for socket 3468
. 2024-11-06 11:13:14.110 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:14.110 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:14.110 Looking for incoming data
. 2024-11-06 11:13:14.110 Looking for network events
. 2024-11-06 11:13:14.110 Access granted
. 2024-11-06 11:13:14.111 Opening main session channel
. 2024-11-06 11:13:14.113 Detected network event
. 2024-11-06 11:13:14.113 Enumerating network events for socket 3468
. 2024-11-06 11:13:14.113 Enumerated 1 network events making 1 cumulative events for socket 3468
. 2024-11-06 11:13:14.113 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:14.113 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:14.113 Looking for incoming data
. 2024-11-06 11:13:14.113 Looking for network events
. 2024-11-06 11:13:14.113 Opened main channel
. 2024-11-06 11:13:14.240 Detected network event
. 2024-11-06 11:13:14.240 Enumerating network events for socket 3468
. 2024-11-06 11:13:14.240 Enumerated 1 network events making 1 cumulative events for socket 3468
. 2024-11-06 11:13:14.240 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:14.240 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:14.240 Looking for incoming data
. 2024-11-06 11:13:14.240 Looking for network events
. 2024-11-06 11:13:14.240 Primary command failed; attempting fallback
. 2024-11-06 11:13:14.320 Detected network event
. 2024-11-06 11:13:14.320 Enumerating network events for socket 3468
. 2024-11-06 11:13:14.320 Enumerated 1 network events making 1 cumulative events for socket 3468
. 2024-11-06 11:13:14.320 Handling network read event on socket 3468 with error 0
. 2024-11-06 11:13:14.320 Waiting for the server to continue with the initialization
. 2024-11-06 11:13:14.320 Looking for incoming data
. 2024-11-06 11:13:14.320 Looking for network events
. 2024-11-06 11:13:14.320 Started a shell/command
. 2024-11-06 11:13:14.320 Timeout waiting for network events
. 2024-11-06 11:13:14.391 --------------------------------------------------------------------------
. 2024-11-06 11:13:14.391 Using SCP protocol.
. 2024-11-06 11:13:14.391 Doing startup conversation with host.
. 2024-11-06 11:13:14.391 Session upkeep
. 2024-11-06 11:13:14.391 Looking for network events
. 2024-11-06 11:13:14.391 Timeout waiting for network events
. 2024-11-06 11:13:14.424 Skipping host startup message (if any).
> 2024-11-06 11:13:14.424 echo "WinSCP: this is end-of-file:0"
. 2024-11-06 11:13:14.424 Sent 37 bytes
. 2024-11-06 11:13:14.424 There are 0 bytes remaining in the send buffer
. 2024-11-06 11:13:14.424 Looking for network events
. 2024-11-06 11:13:14.424 Timeout waiting for network events
. 2024-11-06 11:13:14.424 Waiting for another 1 bytes
. 2024-11-06 11:13:14.424 Looking for incoming data
. 2024-11-06 11:13:14.424 Looking for network events
. 2024-11-06 11:13:30.934 Timeout waiting for network events
. 2024-11-06 11:13:30.934 Waiting for data timed out, asking user what to do.
. 2024-11-06 11:13:30.934 Asking user:
. 2024-11-06 11:13:30.934 **L'host non sta comunicando da 15 secondi.
. 2024-11-06 11:13:30.934
. 2024-11-06 11:13:30.934  Attendi per altri 15 secondi?** ()
. 2024-11-06 11:13:30.934 Session upkeep
. 2024-11-06 11:13:31.488 Pooling for data in case they finally arrives
. 2024-11-06 11:13:31.488 Looking for network events
. 2024-11-06 11:13:31.488 Timeout waiting for network events
. 2024-11-06 11:13:31.944 Session upkeep
. 2024-11-06 11:13:31.990 Pooling for data in case they finally arrives
. 2024-11-06 11:13:31.990 Looking for network events
. 2024-11-06 11:13:31.990 Timeout waiting for network events
. 2024-11-06 11:13:32.229 Answer: Abort
. 2024-11-06 11:13:32.229 Attempt to close connection due to fatal exception:
* 2024-11-06 11:13:32.229 **Terminato dall'utente.**
. 2024-11-06 11:13:32.229 Closing connection.
. 2024-11-06 11:13:32.229 Sending special code: 1
. 2024-11-06 11:13:32.229 Looking for network events
. 2024-11-06 11:13:32.337 Timeout waiting for network events
. 2024-11-06 11:13:32.337 Looking for network events
.  2024-11-06 11:13:32.447 Timeout waiting for network events
. 2024-11-06 11:13:32.447 Looking for network events
. 2024-11-06 11:13:32.557 Timeout waiting for network events
. 2024-11-06 11:13:32.557 Looking for network events
. 2024-11-06 11:13:32.668 Timeout waiting for network events
. 2024-11-06 11:13:32.668 Looking for network events
. 2024-11-06 11:13:32.780 Timeout waiting for network events
. 2024-11-06 11:13:32.780 Selecting events 0 for socket 3468
* 2024-11-06 11:13:32.840 (EFatal) **Terminato dall'utente.**
* 2024-11-06 11:13:32.840 Errore dis alto del messaggio iniziale. L'interprete dei comandi probabilmente è incompatibile con l'applicazione (si raccomanda BASH).
Возможно, это проблема управления командами оболочки.
Я не нашел никакого руководства.

Подробнее здесь: https://stackoverflow.com/questions/790 ... onnections
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • SFTP-сервер на Python с Paramiko не разрешает SFTP-соединения
    Anonymous » » в форуме Python
    0 Ответы
    41 Просмотры
    Последнее сообщение Anonymous
  • SFTP-сервер на Python с Paramiko не разрешает SFTP-соединения
    Anonymous » » в форуме Python
    0 Ответы
    32 Просмотры
    Последнее сообщение Anonymous
  • SFTP-сервер на Python с Paramiko не разрешает SFTP-соединения
    Anonymous » » в форуме Python
    0 Ответы
    41 Просмотры
    Последнее сообщение Anonymous
  • SFTP-сервер на Python с Paramiko не разрешает SFTP-соединения
    Anonymous » » в форуме Python
    0 Ответы
    16 Просмотры
    Последнее сообщение Anonymous
  • Возобновить загрузку SFTP после сбоя соединения (pysftp/paramiko)
    Anonymous » » в форуме Python
    0 Ответы
    34 Просмотры
    Последнее сообщение Anonymous

Вернуться в «Python»