How to set up an SFTP server
Transfer files with your server using an encrypted protocol.
Table of Contents
SFTP is based on SSH, so you need to have SSH server installed (Creating an SSH server). For the same reason, you need to open port 22 on your server network (or the SSSH port you want to use, in that case remember to edit
You need an SFTP client, like Filezilla.
Create an SFTP user
By default, any user who can login through SSH, can login through SFTP. But if you want a user that cannot use SSH, but only SFTP, you can follow these steps (as root or using sudo):
- Create a new user (in this case “juan”).
useradd -m juan
-mcreates a home folder for the user. This is optional, but we will use this folder for SFTP.
- Set a password for “juan”.
/etc/ssh/sshd_configand add this at the end.
Match User juan ChrootDirectory /home ForceCommand internal-sftp
- You can use another folder for the root directory, but that folder needs to be owned by “root” and only writable by “root”. Inside that folder you can create folders owned by the SFTP user.
# you can reload instead of restart systemctl restart ssh
In Debian/Ubuntu systems, you can use
dpkg-reconfigureto reconfigure an installed package using intuitive dialogs. I will show you how to use this command to change some system settings.
If you have a scanned PDF and you want to be able to search and copy text from it, in this tutorial I will show you how to do it.
If you want to do X11 forwarding from your container to your host, you can type these simple commands.
If you don’t have a Graphical User Interface (GUI) on your Linux device, or you need a simple text-based web browser, I will show you a couple of great programs.
A comprehensive list of Linux-related websites sorted by categories.