OpenSSH provides a secure and encrypted communication channel for remote login and file transfer. In this tutorial, we will walk you through the process of installing OpenSSH SFTP server on MXLinux Latest.
Before installing any package, it is recommended to update the system. Open the terminal and run the following command:
sudo apt-get update && sudo apt-get upgrade
OpenSSH is available in the default repositories of MXLinux. To install OpenSSH server, run the following command:
sudo apt-get install openssh-server
The default configuration file of OpenSSH server is located at /etc/ssh/sshd_config. Open the configuration file with any text editor of your choice. Find the following line:
#Subsystem sftp /usr/lib/openssh/sftp-server
Uncomment the line by removing the "#" symbol at the beginning and change it to:
Subsystem sftp internal-sftp
This will enable the SFTP server and disable the shell access.
To apply the changes, restart the OpenSSH server by running the following command:
sudo systemctl restart ssh
To create an SFTP user, run the following command:
sudo useradd -m -s /bin/false sftpuser
The above command will create an SFTP user named "sftpuser" with a home directory and no shell access. You can replace "sftpuser" with any username of your choice.
To set a password for the SFTP user, run the following command:
sudo passwd sftpuser
Follow the on-screen prompts to set the password.
To test the SFTP connection, open any SFTP client such as FileZilla or WinSCP. Enter the IP address of the MXLinux machine, port 22, and the SFTP username and password.
Congratulations! You have successfully installed and configured OpenSSH SFTP server on MXLinux 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!