SFTPGo is a modern, secure, and highly configurable SFTP server written in Go. It offers rich features like file storage backends, virtual folders, API access, and built-in logging. By installing SFTPGo on an AnonVM server, you can secure file transfers and gain robust access management for users. This guide walks you through the steps to install and configure SFTPGo on your AnonVM server.
Table of Contents
- Prerequisites
- Installing SFTPGo on AnonVM
- Configuring SFTPGo
- Adding Users and Setting Permissions
- Managing SFTPGo Server
- Testing the SFTPGo Setup
- Security and Optimization Tips
1. Prerequisites
Ensure you have:
- AnonVM VPS or dedicated server running a Linux distribution like Ubuntu or Debian.
- Root access or sudo privileges.
- Basic command-line knowledge.
In this guide, we’ll be using Ubuntu 22.04 LTS.
2. Installing SFTPGo on AnonVM
-
Download the Latest Release: Start by fetching the latest SFTPGo binary release:
-
Install the SFTPGo Package: Use
dpkg
to install the downloaded.deb
package:To resolve any dependencies:
-
Start and Enable SFTPGo Service:
-
Verify Installation: Check if SFTPGo is running:
3. Configuring SFTPGo
The main configuration file for SFTPGo is located at /etc/sftpgo/sftpgo.json
. Open it for editing:
Adjust the configuration to match your needs:
- Default Ports: The default SFTP port is
2022
, but you can change it if desired. - Data Storage: Choose between a built-in SQLite database or configure MySQL/PostgreSQL for larger deployments.
After making changes, save the file and restart SFTPGo:
4. Adding Users and Setting Permissions
With SFTPGo, you can add users via the command line or the API. To add a user:
-
Use the SFTPGo Admin CLI:
Follow the prompts to configure the new user’s:
- Username and password for authentication.
- Home directory and virtual folder settings.
- Permissions (such as read, write, or list).
-
Customize User Permissions: To customize permissions further, reopen
/etc/sftpgo/sftpgo.json
and set specific rules for each user, including bandwidth limits, file quotas, and IP restrictions.
5. Managing SFTPGo Server
To manage and monitor your SFTPGo server effectively, you can utilize system commands:
-
Restart SFTPGo:
-
View Logs for activity and error tracking:
-
Check Active Connections: You can monitor connections via the SFTPGo API or logs, which provide detailed insight into active sessions.
6. Testing the SFTPGo Setup
To verify that SFTPGo is working correctly:
-
Connect Using an SFTP Client: Use any SFTP client (e.g., FileZilla, WinSCP) and enter the following details:
- Host: Your AnonVM server IP
- Port: 2022 (or your configured SFTPGo port)
- Username and password: The credentials you set in Step 4
-
Test File Transfers: Upload and download test files to ensure that the permissions and speed meet your expectations.
-
CLI Connection: From the command line, you can test with:
Replace
your_username
andyour_server_ip
with your actual SFTPGo credentials.
7. Security and Optimization Tips
Enhance the security and efficiency of your SFTPGo server with these tips:
-
Firewall Configuration: Use
ufw
to allow only specific IPs to access the SFTP port (default: 2022): -
Enable Logging: SFTPGo provides extensive logging options. Configure logging settings in
/etc/sftpgo/sftpgo.json
to track user activities and detect unauthorized access attempts. -
Restrict Access by IP: Limit access to trusted IP addresses by setting IP restrictions in user profiles.
-
Enable Multi-Factor Authentication (MFA): For additional security, consider enabling MFA if using API integrations or the SFTPGo web interface.
-
Regular Updates: Keep SFTPGo up-to-date to benefit from security patches and performance improvements:
-
Data Encryption: SFTPGo uses SFTP (SSH File Transfer Protocol), which encrypts data in transit. Ensure SSH keys are securely managed and rotate them regularly if necessary.
-
Optimize Performance:
- Consider using a dedicated storage backend if handling large data volumes.
- Adjust user quotas and rate limits to prevent resource overuse.
Conclusion
With SFTPGo on AnonVM, you've now set up a secure, user-friendly SFTP server for managing file transfers. SFTPGo offers flexibility, robust user control, and powerful logging capabilities, making it ideal for a wide range of file-sharing needs. Remember to regularly monitor logs, update your server, and keep user credentials secure for a reliable SFTP environment.
By following this guide, you ensure your AnonVM setup is optimized for efficient and secure file transfers. Enjoy a streamlined file-sharing experience with SFTPGo!