![SFTP File 22 not found Connection closed SFTP File 22 not found Connection closed](https://code2care.org/macos/sftp-file-22-not-found-connection-closed-solution/images/SFTP File 22 not found Connection closed.png)
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
More Posts related to FTP,
- Check help on commands while being on sftp> prompt
- How to connect to SFTP location using Terminal command
- List of 60 useful FTP Client Commands to access server
- 10 FTP SFTP Clients and Alternatives
- How to Copy a remote file to local using SFTP command?
- How to switch between sftp and Terminal shell
- [Solution] SFTP Connection closed File 22 not found
- FileZilla Connection time out Failed to retrieve directory listing
- How to SFTP to port different than 22 (SFTP Custom port)
More Posts:
- Fix: Spring Boot REST HTTP Status 415 - Unsupported Media Type Error - Java
- Opening mac Terminal - MacOS
- URL Encode cURL HTTP GET\POST Data with Examples - cURL
- Fix Git: Warning: could not find UI helper GitHub.UI on Windows - Git
- What is the Default Admin user and Password for Jenkins - Linux
- Must Know Homebrew Commands for Mac/Linux Users - MacOS
- Setting up Spring Boot 3 + Maven + MySQL + JDBC Example - Java
- How to hide lines in Notepad++ - NotepadPlusPlus