Skip to main content

Azure Storage Account SFTP errors

· 2 min read

As part of standing up and using an Azure Storage account as an SFTP service, I ran into a few issues. This blog post is merely intended to show my findings in case others run into similar issues.

PTY allocation request failed on channel 0​

Even though you appear to have connected successfully, you may see the following errors:

  • PTY allocation request failed on channel 0
  • shell request failed on channel 0

You may laugh, but the solution for this was very simple, switch from SSH to SFTP!

If you were like me, I just flicked to SSH as a habit.

Home Directory is not accessible​

Make sure that the Home directory (Folder) is created in your container, SFTP won't create this for you.

Also make sure that the Home directory for the user, references Container/Folder, like the below:

Azure Portal - Enable SFTP

Wrong username, authentication failed​

When attempting to connect to SFTP using a tool such as WinSCP, I got:

  • Using username "lukeftpuser".
  • Authentication failed.

The username is actually comprised of:

STORAGEACCOUNTNAME+FTPNAME, ie: sftpstorageacc1337.lukeftpuser

WinSCP Connection Azure SFTP

Unable to find Azure Storage SSH Keys​

This is not an error, but Azure Keyvault, does not currently support SSH keypairs, so once they are created by Azure, they are stored in a Microsoft.Compute.sshPublicKeys resource found here: SSH Keys