The syntax looks valid, so the "Connection reset by ... port 22" message usually means the server is closing the connection rather than there being a problem with the sftp command itself.
A few things to check:
- Verify that the SFTP service is running and listening on port 22.
- Confirm the hostname/IP is correct and reachable (
pingorTest-NetConnection <host> -Port 22). - Make sure the server allows SFTP/SSH connections from your client IP.
- Check the SSH/SFTP server logs for the reason the connection was reset (authentication, firewall, or security policy).
If possible, could you share which SFTP server software you're connecting to (OpenSSH, Bitvise, etc.) and the exact command with the hostname masked? That would help narrow it down.