Ubuntu 16.04 – How to Fix SFTP and VSCode SSH Not Working

mobaxtermsftpsshubuntu 16.04visual-studio-code

I use MobaXterm on my windows PC to connect to an Ubuntu 16.04 machine.

I worked well until recently I found that SFTP is not working, so my MobaXterm sftp pane is disappear.

To make sure that is not MobaXterm issue, I also download FileZilla to test SFTP, not working either.

Also, I tried to use VSCode on my windows PC with extension "Remote-SSH" to connect to my Ubuntu machine, but it keeps showing this error:

enter image description here

I am not sure if these connection problems I mentioned above are came from after

  1. I installed zsh on my Ubuntu machine,
  2. I installed XRDP but uninstall after.

Any help I would be very appreciate.

Best Answer

In your zsh configuration, does anything output right after you login or open a terminal?

I had a similar issue where rsync would complain about a dirty terminal (I forget the exact message, but basically rsync didn't see what it was expecting to see in the remote connection). It turned out, the problem was the fortune command I had added to my .bashrc; it was printing out a fortune message at the start of every SSH connection, regardless of if it was an interactive session or not.

In my case, I added the below snippet to the top of my .bashrc, which cleared up the problem:

# If not running interactively, don't do anything
[[ $- != *i* ]] && return
Related Question