SFTP is considered more a secure alternative to FTP and FTPS. The FTP server is needed as the native SSH server is used instead, and SSH does not require an SSL certificate. One drawback is the default configuration of SFTP does not restrict access to the user’s home directory. A chroot’ed setup can easily be configure and incorporated with Virtualmin.
Create sftponly group
Create chroot directories
Virtualmin chroot setup script
Modify ssh server
Restart SSH Server
Virtualmin Configuration Changes
Virtualmin -> System Settings -> Virtualmin Configuration -> Defaults for new domains -> Home directory base:
Virtualmin -> System Settings -> Virtualmin Configuration -> Defaults for new domains -> Home subdirectory:
Virtualmin -> System Settings -> Virtualmin Configuration ->Actions upon server and user creation -> Command to run before making changes to a server:
Virtualmin -> System Settings -> Virtualmin Configuration ->Actions upon server and user creation -> Command to run after making changes to a server:
Enforcing SFTP only access on a user