Skip to content

Install SFTP

AlgoSecureAdmin edited this page Jul 6, 2020 · 1 revision

Manual install

Install Backbone SFTP server with openssh

First, access a terminal on desired server then:

Install OpenSSH Server:

$ sudo apt-get install openssh-server

Add and setup permissions on a pollenisator user:

$ sudo adduser pollenisator

$ sudo usermod -s /bin/false pollenisator

$ sudo usermod -d / pollenisator

$ sudo mkdir -p /etc/Pollenisator/files/

$ sudo chown root.root /etc/Pollenisator

$ sudo chown pollenisator.pollenisator /etc/Pollenisator/files

Change the password using the following command for the new pollenisator user

$ sudo passwd pollenisator

Then open your sshd config file (located in /etc/ssh/sshd_config) For example with nano

$ sudo nano /etc/ssh/sshd_config

And replace the line: Subsystem sftp /usr/lib/openssh/sftp-server

By

Subsystem sftp internal-sftp

And add at the end of the file:

Match User pollenisator
	ChrootDirectory /etc/Pollenisator/
	PermitTunnel no
	X11Forwarding no
	AllowTcpForwarding no
	ForceCommand internal-sftp
	PasswordAuthentication yes

Then restart the ssh service:

$ sudo systemctl restart ssh

Clone this wiki locally