SFTP server on CentOS Linux with chrooted RW and chrooted RO user

SFTP (SSH File Transfer Protocol or Secure File Transfer Protocol) is network protocol for fafe transfer and access to files over network – so nobody cannot sniff traffic between you and server in ManInTheMiddle scenario.

In this task we need to create SFTP server on CentOS 7 Minimal Linux, with two chrooted SFTP users with no shell access, one user need to have only read-only (RO) access and second need to have read-write (RW) access. Everything need to be configured without ACL (access control list) feature.

We will do everything using temporarily variables because it’s easier to use for any other users which we need to create, so you need only in first step to configure RW and RO user, SFTP location and name of a folder for SFTP (in this example name will be Files). You can use copy-paste for your server but, of course bee careful if you use this on some of your proportional servers.