SFTPGo is an open-source freeware FTP server that allows you to securely transfer files over a network. In this tutorial, we'll show you how to install SFTPGo on FreeBSD Latest.
Before you begin, ensure you have the following:
First, update FreeBSD's package manager and its packages to ensure you have the latest version.
To do this, run the following command:
sudo pkg update && sudo pkg upgrade
SFTPGo requires several dependencies to function correctly. We need to install them using the package manager.
To install the packages, run the following command:
sudo pkg install git go nano
Here, we need the git
package to clone the SFTPGo repository, the go
package to compile SFTPGo, and nano
to edit configuration files.
Clone SFTPGo's repository from GitHub to your FreeBSD system.
To do this, run the following command:
git clone https://github.com/drakkan/sftpgo.git
Once you've downloaded the repository, navigate to the "sftpgo" directory.
cd sftpgo
Next, we need to compile SFTPGo using the go
command.
To compile SFTPGo, run the following command:
go build -o sftpgo main.go
This command will create a binary file named "sftpgo" in the current directory.
SFTPGo runs under a user account dedicated to it. Hence, we need to create a user for SFTPGo.
To create a user, use the following command:
sudo adduser --system --no-create-home --disabled-login --shell /sbin/nologin sftpgo
Here, we've created a system user account named "sftpgo" with no login privileges and no home directory.
Now, we need to configure SFTPGo by editing the "sftpgo.conf" file.
To edit the configuration file, use the following command:
sudo nano sftpgo.conf
Inside the file, we need to specify:
listen_addr
parameter.user
and group
.accounts
parameter.For example:
listen_addr: "0.0.0.0:22"
user: "sftpgo"
group: "sftpgo"
accounts:
- user1:
password: "password1"
home_dir: "/home/user1"
- user2:
password: "password2"
home_dir: "/home/user2"
Here, we've set SFTPGo to listen on all the network interfaces on port "22". We've also created two accounts with their home directory and password.
Once you've finished editing the file, save it and exit the editor.
Finally, start SFTPGo by running the sftpgo
binary with the configuration file as an argument.
To do this, run the following command:
sudo ./sftpgo --config sftpgo.conf
If everything is correct, SFTPGo will start, and you'll be able to connect to it using an SFTP client.
That's it! You've successfully installed and configured SFTPGo on FreeBSD Latest.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!