Voici un tutoriel sur l’installation d’un serveur SFTP

  • Source : https://www.server-world.info/en/note?os=Debian_9&p=ssh&f=5
  • Etat : Terminé mais a traduire


SFTP - Filezilla

Requis :

  • Un serveur ubuntu 16.04
SFTP only + Chroot2017/06/21
Configure SFTP only + Chroot.
Some users who are applied this settings can access only with SFTP and access to the permitted directories.
[1]For example, Set /home as the Chroot directory.
# create a group for SFTP
root@dlp:~# groupadd sftp_users
# apply to a user [debian] for SFTP only as an example
root@dlp:~# usermod -G sftp_users debian
root@dlp:~# vi /etc/ssh/sshd_config # line 116: comment out and add a line like below
#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp # add to the end
Match Group sftp_users
  X11Forwarding no
  AllowTcpForwarding no
  ChrootDirectory /home
  ForceCommand internal-sftp root@dlp:~# systemctl restart ssh
[2]Try to access with a user and make sure the settings.
debian@www:~$ ssh debian@
debian@’s password:
This service allows sftp connections only.
Connection to closed.     # denied normally debian@www:~$ sftp debian@
Connecting to…
debian@’s password:
sftp> ls -l
drwxr-xr-x 3 1001 1001 4096 Apr 23 03:11 debian drwxr-xr-x 4 1000 1000 4096 Apr 24 12:24 strech sftp> pwd
Remote working directory: /
sftp> exit