


You can now use this server to transfer files securely between systems.Īlso Read: How to Install Brave Web Browser on Ubuntu 22.Downloading files from a server and uploading them to one might not be something that you need to do as an everyday occurrence. Great! output above confirm that you have successfully set up an SFTP server on Ubuntu 22.04. Connect to your SFTP server using the IP address or hostname of your server, username and password of the newly created user, $ sftp Now, you can test the SFTP connection using any SFTP client. The AllowTcpForwarding directive will disable TCP forwarding, which can be used to bypass restrictions.Īfter configuring the SSH server, you need to restart it using the following command: $ sudo systemctl restart sshd 5) Test SFTP Server.The ForceCommand directive will force the use of the internal-sftp subsystem and disable all other SSH functionality.The ChrootDirectory directive will change the root directory of the SFTP user to their home directory.This group will be used to restrict SFTP users to their home directories. The Match Group directive will create a group “sftp”.Open the sshd_config file using vi editor, $ sudo vi /etc/ssh/sshd_configĬhange ‘ Subsystem sftp /usr/lib/openssh/sftp-server‘ to ‘ Subsystem sftp internal-sftp‘Īdd the following lines at the end of the file: Match group sftp Once you have created group and new user, you need to configure the SSH server to allow SFTP access. In the last, grant full permissions to user’s home directory, run $ sudo chmod 700 /home/sftpuser/ 3) Configure SSH Server Now, create a user and add it to sftp group, $ sudo useradd -m sftpuser -g sftpĪssign password to sftpuser, $ sudo passwd sftpuser Before creating a user, let’s first create group with a name “ sftp” $ sudo groupadd sftp

It’s always a good practice to create a new user for SFTP transfers. $ sudo apt install ssh -y 2) Create SFTP Group and User To install SSH server, open your terminal and type the following command: $ sudo apt update To set up an SFTP server, you need to have an SSH server installed.
