Command line SFTP on Windows 10
Mia Lopez
I am getting strange key board behavior when I try to connect to an FTP server using Windows 10 on the command line...
>sftp
The authenticity of host 'something.something.com (12.345.67.89)' can't be established.
ECDSA key fingerprint is xxxxx:dkjhroihoiohgnb9q94904oeie844598576984deoh.
Are you sure you want to continue connecting (yes/no/[fingerprint])?At this point I cannot type 'y' or anything else. The keyboard has been disabled somehow. Only the enter key works and the command aborts.
The same behavior occurs on two different Windows 10 machines, a desktop and laptop.
Finally, I downloaded WinSCP and was successful at connecting to the ftp server using this GUI but I would prefer the command line.
Any ideas of what is going on with the command line behavior?
22 Answers
The ECDSA fingerprint warning is because the host name in your .ssh\known_hosts file shows a different fingerprint since the last time you logged in. This can be a serious security concern.
Therefore, the warning it gives you requires that you type the entire word 'yes' to proceed. It may be that the terminal is not showing you the characters being typed so try typing the full word and then hitting enter.
The sftp command is expecting you to respond with "yes" or "no" or the fingerprint. It does not echo anything, so it appears as though the keyboard is locked like you were entering the password. Also, things like backspace or CTRL+V do not work.
If you intend to use the fingerprint option, the input requires "SHA256:" at the front. If you want to paste this in, you will need to use Edit > Paste from the dropdown menu in the upper left corner.
As a general rule though, this sort of command line is not very safe as you would be hard pressed to verify the fingerprint by looking at it. You can force the use of known hosts with StrictHostKeyChecking enabled.
sftp -oStrictHostKeyChecking=true Of course, you will need to prepare your known hosts file with the fingerprint details in advance.
I have not found documentation for sftp at Microsoft, but it is essentially what you will find in Linux man pages and similar sources such as man 1 sftp.