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:
- How to install Roblox Game on Mac [Intel/M1/M2] - MacOS
- [Fix] zsh: command not found: nvm - MacOS
- GitHub: How to Search Code - Git
- Compare two text files in Notepad++ - NotepadPlusPlus
- How to extract Java Jar/War/Ear files in Linux - Java
- Convert String to LocalDate in Java - Java
- 7 Python Arithmetic Operators with Examples [Tutorial] - Python
- Fix - Project JDK is misconfigured in IntelliJ - Java