I have a new Ubuntu 18.04.3. I can SSH fine, but I can't SFTP.


enter image description here


enter image description here

This is my SSH configs

Port 8200                                                                                                                                              
PermitRootLogin yes                                                                                                                            
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no                                                                                                                                            
AcceptEnv LANG LC_*                                                                                                                                    
Subsystem      sftp    /usr/lib/openssh/sftp-server 
MaxAuthTries 100
AllowUsers forge 

I checked logs

tail -f /var/log/auth.log

I see this appended each time it failed

Jun 30 13:27:18 websocket sshd[3353]: Connection closed by port 51216 [preauth]

How do I make my SFTP to work ?

What should I check ?

  • What else is logged? – Michael Hampton Jun 30 at 18:32
  • When I tried, I failed, only one line appended. What else should I checked or try ? – cyber8200 Jun 30 at 18:33

if you're using passwords for sftp connections - then "PasswordAuthentication no" should be replaced to "PasswordAuthentication yes"

  • don't forget to restart sshd.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.