Estou configurando um acesso SFTP de uma máquina linux (cliente) para uma máquina windows 2012 (servidor).
No lado do servidor, estou executando o coreFTPServer configurado para FTP apenas por SSH e somente com a chave auth. Usando o cliente coreFPT no meu laptop do Windows, posso estabelecer uma conexão com sucesso. Em vez disso, ao usar a mesma rede e credenciais, não consigo me conectar através do cliente linux.
Eu uso o seguinte, a chave não é criptografada com uma frase secreta:
sftp -i .ssh/priv -P 22 -vvv configured_user@server_ip
e recebo a seguinte saída, com depuração no nível 3 (digitei ip e nome de usuário):
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "10.135.150.2" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to <server_ip> [<server_ip>] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file .ssh/priv type -1
debug1: key_load_public: No such file or directory
debug1: identity file .ssh/priv-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version CoreFTP-0.3.3
debug1: no match: CoreFTP-0.3.3
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to <server_ip>:22 as '<configured_user>'
debug3: hostkeys_foreach: reading file ".ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file .ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from <server_ip>
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,ext-info-c
debug2: host key algorithms: [email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa,[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-dss
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256
debug2: host key algorithms: ssh-rsa
debug2: ciphers ctos: aes128-cbc,aes128-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes192-ctr,aes256-cbc,aes256-ctr,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,[email protected]
debug2: ciphers stoc: aes128-cbc,aes128-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes192-ctr,aes256-cbc,aes256-ctr,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,[email protected]
debug2: MACs ctos: hmac-sha2-256,hmac-sha1,hmac-md5,none
debug2: MACs stoc: hmac-sha2-256,hmac-sha1,hmac-md5,none
debug2: compression ctos: none,none
debug2: compression stoc: none,none
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: diffie-hellman-group-exchange-sha256 need=32 dh_need=32
debug1: kex: diffie-hellman-group-exchange-sha256 need=32 dh_need=32
debug3: send packet: type 34
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<8192<8192) sent
debug3: receive packet: type 31
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug2: bits set: 4082/8192
debug3: send packet: type 32
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug3: receive packet: type 33
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:g1vBYrOo0avwG21dmFm6I6XDA+B4eepZC6+h80TH+XY
debug3: hostkeys_foreach: reading file ".ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file .ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from <server_ip>
debug1: Host '<server_ip>' is known and matches the RSA host key.
debug1: Found key in .ssh/known_hosts:1
debug2: bits set: 4070/8192
ssh_dispatch_run_fatal: Connection to <server_ip> port 22: invalid argument
Couldn't read packet: Connection reset by peer
O problema parece estar vindo do ssh:
ssh_dispatch_run_fatal: Connection to <server_ip> port 22: invalid argument
Couldn't read packet: Connection reset by peer
mas não consegui identificar a causa, tentei com vários keypairs, gerados tanto do lado do cliente com ssh-keygen (RSA e DSA) quanto do lado do servidor com CoreFTPServer (prefiro generete-los do lado do cliente embora e então troque apenas a chave do pub).
O que estou perdendo?
Obrigado