I’m working on a project to create an SFTP Scheduler, and needed an SFTP server to test with. I work on Windows but have an Ubuntu virtual machine that I run through Hyper-V - and I didn’t realise how easy it was to set up a test server. For my future self, here are the steps:
Run Ubuntu virtual machine and log in. The SFTP account will be a local user account, so create one now:
sudo adduser sftp-test
Enter a password, and complete any of the other questions. You now have an account you can test with - when the SFTP client logs in it will have access to the above user’s home directory on the machine.
Install the SFTP server
sudo apt install -y openssh-server
Run the server
sudo service ssh start
Configure the client
And that’s it!