How to Install SFTPGo on Alpine Linux Latest
SFTPGo is an open-source SFTP server that supports many features including virtual folders, user and permission management, and detailed logs. Here's how to install it on Alpine Linux Latest.
Prerequisites
- A server running Alpine Linux Latest.
- Root access or a non-root user with sudo permissions.
Installation
Step 1. Install dependencies
Before installing SFTPGo, make sure the following dependencies are installed:
sudo apk add --no-cache git go libcap libcap-dev
Step 2. Download SFTPGo
Clone SFTPGo from GitHub:
git clone https://github.com/drakkan/sftpgo.git
Step 3. Build SFTPGo
Navigate to the directory containing the cloned repository and build SFTPGo:
cd sftpgo/
make build
This command will download all the necessary packages and dependencies to build SFTPGo.
Step 4. Configure SFTPGo
Create a configuration file for SFTPGo:
sudo mkdir -p /etc/sftpgo && sudo touch /etc/sftpgo/sftpgo.yaml
Edit the configuration file with your preferred text editor:
sudo nano /etc/sftpgo/sftpgo.yaml
Add the following configuration to the file:
listen_address: ":22"
ssh_host_keys:
- file: "ssh_host_key"
type: "ecdsa"
- file: "ssh_host_rsa_key"
type: "rsa"
auth:
type: "basic"
users:
- username: "user1"
password: "password1"
homedir: "/home/user1"
permissions:
- path: "/"
readonly: true
- path: "/upload"
- username: "user2"
password: "password2"
homedir: "/home/user2"
This configuration sets up SFTPGo to listen on port 22 and uses basic authentication to authenticate users. It also creates two users, user1 and user2, with their respective home directories and permission settings.
Step 5. Install and Run SFTPGo
Install and start SFTPGo with the following command:
sudo make install && sudo make run
This command will install SFTPGo as a daemon and start the server.
Step 6. Verify SFTPGo
To verify that SFTPGo is running, connect to it using an SFTP client. You should be able to authenticate and access your configured directories.
Conclusion
Congratulations! You now have SFTPGo installed on your Alpine Linux Latest server. You can further configure SFTPGo by modifying the configuration file as per your requirements.