This documentation guides you through setting up a simple SFTP server implemented using the Apache Mina SSHD library, Java, and Spring Boot. This server is designed for testing.
To start the server, you can either run the SftpServerApplication.java class from your IDE or use the following commands from the command line:
mvn clean install
mvn spring-boot:run
Execute the following command to test the SFTP session. The password is 'password'.
sftp -oPort=2222 foo@localhost
The first time you run this command, it will prompt you to add the host key to your local ~/.ssh/known_hosts
file. You can now retrieve the saved host key from your known_hosts
file for use.
Example prompt:
The authenticity of host '[localhost]:2222 ([::1]:2222)' can't be established.
RSA key fingerprint is SHA256:0lUTPTgivp12WiWr/6O+9BEiU1sAkzCneIlAnTNntU4.
Are you sure you want to continue connecting (yes/no)?
For more detailed information on how this SFTP server is implemented, you can refer to the following articles: