[Solution] SFTP Connection closed File 22 not found


SFTP File 22 not found Connection closed
SFTP Connection closed

If you are trying to connect to SFTP address using the command line and SFTP command and you get the error "File "/22" not found." then the reason is that you have tried to provide port 22 which is the default port for SFTP instead of providing the path, you do not need to provide the port number if the server is hosted on the default 22 port.

Error:
% sftp demo@code2care.org:22   
(demo@code2care.org) Password: 
Connected to code2care.org.
File "/22" not found.
Connection closed.  
% 
Reason:

You have provided the port, instead of the directory/path location, user@host:dir-location.

Solution:

If you want to provide the port you can make use of -P option followed by the port number

Example:
% sftp -P 22 user@code2care.com

(user@192.168.0.4) Password: 

Connected to code2care.com

sftp> 

Read more: https://code2care.org/macos/sftp-to-different-than-22-custom-post



















Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap