SFTP refers to various forms of (more or less) secure file transfer protocols. This article lists two examples and how to set them up.

−

= Introduction =

+

== SSH file transfer protocol ==

−

SFTP ('Secure File Transfer Protocol') encrypts passwords unlike plain FTP. SFTP is not really a true protocol, its just SSH + FTP or TLS/SSL + FTP . Note that there are many ways to do this. This is one of them.

This setup in particular (using pure-ftpd) encrypts usernames, passwords, commands and server replies, but does NOT encrypt the data channel. This also means that that there is reduced performance cost on data transfer.

+

=== Setting up SSH file transfer protocol with OpenSSH ===

−

= Setting up FTP with pure-ftpd =

+

To set up SFTP you only need to install and configure [[SSH#OpenSSH|OpenSSH]]. Once you have this running, SFTP is running too because the default configuration file enables it. Follow the instructions below for older configs.

−

we will use pure-ftpd:

−

pacman -Sy pure-ftpd openssh openssl

+

1. Open {{ic|/etc/ssh/sshd_config}} with your favorite editor and add this line if it does not already exist:

+

Subsystem sftp /usr/lib/ssh/sftp-server

+

2. Restart the SSH-daemon with:

+

# systemctl restart sshd.service

−

then you can go ahead and edit the configuration file:

+

And it should work. You can access your files with the sftp program or [[sshfs]]. Many standard FTP programs should work as well.

−

vi /etc/pure-ftpd.conf

+

== FTP over SSH ==

−

you can start and stop the pure-ftpd daemon by

+

[http://en.wikipedia.org/wiki/FTP_over_SSH#FTP_over_SSH_.28not_SFTP.29 FTP over SSH] encrypts passwords unlike plain FTP. FTP over SSH is not really a true protocol, it is just SSH + FTP or TLS/SSL + FTP . Note that there are many ways to set this up. This is one of them.

−

/etc/rc.d/pure-ftpd start

+

This setup in particular (using {{AUR|pure-ftpd}} + TLS) encrypts usernames, passwords, commands and server replies, but does NOT encrypt the data channel. This also means that there is reduced performance cost on data transfer.

−

/etc/rc.d/pure-ftpd stop

−

/etc/rc.d/pure-ftpd restart

−

and you can set it to automatically start by adding it to the modules list in /etc/rc.conf

SSH file transfer protocol

Setting up SSH file transfer protocol with OpenSSH

To set up SFTP you only need to install and configure OpenSSH. Once you have this running, SFTP is running too because the default configuration file enables it. Follow the instructions below for older configs.

1. Open /etc/ssh/sshd_config with your favorite editor and add this line if it does not already exist:

Subsystem sftp /usr/lib/ssh/sftp-server

2. Restart the SSH-daemon with:

# systemctl restart sshd.service

And it should work. You can access your files with the sftp program or sshfs. Many standard FTP programs should work as well.

FTP over SSH

FTP over SSH encrypts passwords unlike plain FTP. FTP over SSH is not really a true protocol, it is just SSH + FTP or TLS/SSL + FTP . Note that there are many ways to set this up. This is one of them.

This setup in particular (using pure-ftpdAUR + TLS) encrypts usernames, passwords, commands and server replies, but does NOT encrypt the data channel. This also means that there is reduced performance cost on data transfer.