Create SFTP account programmatically on C#

mark roda

Nov 24, 2020
cPanel Access Level
Website Owner
I need a way to programmatically create an SFTP account that allows a user to upload to their own SFTP account.

here is an example scenario, a user comes onto a website and creates an account. then the server creates an SFTP director, username and password, and emails it to the user. then the user can start uploading files. using an sftp client.


  1. is there any API in cpanel that can be called to do this? .. if yes, how?
  2. or is there any C# library or something that runs on the server that can create an SFTP folder and create credentials for the user?


Jurassic Moderator
Staff member
Oct 19, 2014
cPanel Access Level
Root Administrator
Hey there! There are cPanel API calls to create an FTP user ( but due to how cPanel users interact with SSH, sFTP is only available to the main cPanel username on the system and not additional FTP users. Since that is the case, there wouldn't be a way to do this that interfaces with the cPanel tools.

There are definitely ways to create a system user with sFTP access outside of cPanel, but that isn't something I'd be able to provide advice for as that isn't something we test and configure.