A client and server implementation that follows the specifications detailed in the RFC 913: SFTP document.
Although this implementation is designed to be cross-platform, the associated scripts are designed to be run on a Linux system. Development was carried out using Ubuntu 20.04.4 and Windows 10 with JDK 11.
- Please ensure the
javacandjavacommands from JDK 11+ are on your system PATH before attempting to run - The Server is run on port
6789, please ensure no other processes exist on this address before starting - The "file system" used by this project can be found in
src/resources/home
- Open a new terminal/command prompt
- Change directory to the
scriptsdirectory - Execute the 'runServer' script with
./runServer.shto start the server - A message will be displayed stating that the server was successfully started
- Open a new terminal/command prompt
- Change directory to the
scriptsdirectory - Execute the 'runClient' script with
./runClient.shto start the client - A message will be displayed stating that the client successfully connected to the server followed by a greeting from the server
Once a client has connected to the server, commands can be sent and the server will respond accordingly.
The available users as well as their associated accounts and passwords are shown below. Please note that users 1-5 are used during the test script and the contents of their respective folders are not to be changed. The files associated with these users can be found in src/resources/home.
| User-id | Account | Password |
|---|---|---|
| user1 | ||
| user2 | acct1 | |
| user3 | pass3 | |
| user4 | acct1 | pass4 |
| user5 | acct1 acct2 acct3 | pass5 |
| user6 | acct1 acct2 acct3 acct4 | pass6 |
- All commands from the RFC 913: SFTP specification have been implemented
- The server supports multithreaded socket connections, each client connection will run on a unique thread
- Each user is assigned a unique folder on the server which they are locked to
- Relative and absolute filepaths are supported for the
CDIRcommand, the user's folder is translated as the root directory
- Ensure the server is running
- Open a new terminal/command prompt
- Change directory to the
scriptsdirectory - Execute the test script with
./runTests.sh
To ensure a consistent test environment the script attempts to delete any files generated by tests; it does this once at the start and end of the test suite. If needed, the generated files can be retained by running ./runTests.sh --keep.