VSCode SFTP plugin connecting with private key error:OPENSSL_internal:DECODE_ERROR

When I'm trying to upload file using SFTP extension in Visual Studio Code, following error is shown:

Full stack trace is

The ssh connection is using public key authentication, and my sftp configuration (sftp.json) is like following:


To fix this error, we can convert the private key file from OpenSSH private key format to PEM format.

Try again it will work now.

SFTP ls command returns no files

I created a new user called phone for the client, and created a new directory /home/phone as his home directory. Next create some files for testing purpose.

Then modify /etc/ssh/sshd_config to set chroot configuration

But logging in with this new user and run ls command, no files are listed, it returns nothing.. But if I run ls in ssh, the files are shown.

After trying lots of time, the reason is found: It's because there is no "x" permission for /home/phone directory..

What is "x" permission?

The "x" permission for directory is used to traverse directory. And the "x" permission for file is for file execution.

Then run following command to add "x" permission for /home/phone

And try running ls command in sftp again, the issue is fixed now, we can see files are listed now.