apt-get install vsftpd openssh-server
in /etc/vsftpd.conf
:
write_enable=YES
local_umask=022
chroot_local_user=YES
# to be added
allow_writeable_chroot=YES
pasv_enable=Yes
pasv_min_port=40000
pasv_max_port=40100
in /etc/ssh/sshd_config
:
comment the following line
Subsystem sftp /usr/lib/openssh/sftp-server
and add
Subsystem sftp internal-sftp
Match group ftpaccess
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
in /etc/shells
add:
/usr/sbin/nologin
then:
groupadd ftpaccess
useradd -m ftp_user -g ftpaccess -s /usr/sbin/nologin
passwd ftp_user
chown root /home/ftp_user
mkdir /home/ftp_user/drop_here
chown ftp_user:ftpaccess /home/ftp_user/drop_here
people can now connect via port 22 with ftp_user
and the passord you set using passwd ftp_user
.