Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
linux:ubuntu:sftp [2022/02/12 07:45] marclebrun [Créer un utilisateur] |
linux:ubuntu:sftp [2022/02/12 08:00] (Version actuelle) |
||
---|---|---|---|
Ligne 38: | Ligne 38: | ||
Le répertoire **/home/tartempion** doit appartenir à **root** | Le répertoire **/home/tartempion** doit appartenir à **root** | ||
pour les besoin du **chroot**. | pour les besoin du **chroot**. | ||
- | |||
- | <code> | ||
- | drwxr-wr-w root:root tartempion | ||
- | </code> | ||
Créer le sous-répertoire **data** qui doit appartenir à **tartempion** | Créer le sous-répertoire **data** qui doit appartenir à **tartempion** | ||
Ligne 48: | Ligne 44: | ||
sudo mkdir /home/tartempion/data | sudo mkdir /home/tartempion/data | ||
chown tartempion:sftpusers /home/tartempion/data | chown tartempion:sftpusers /home/tartempion/data | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | drwxr-xr-x root:root /home/tartempion | ||
+ | drwxr-xr-x tartempion:sftpusers /home/tartempion/data | ||
</code> | </code> | ||
Ligne 61: | Ligne 62: | ||
</code> | </code> | ||
- | Ajouter des règles pour le groupe **sftpusers** | + | Ajouter des règles pour le groupe **à la fin** du fichier : |
- | + | ||
- | Ajouter ceci **à la fin** du fichier : | + | |
<code> | <code> | ||
- | match Group sftpusers | + | Match Group sftpusers |
X11Forwarding no | X11Forwarding no | ||
AllowTcpForwarding no | AllowTcpForwarding no | ||
- | ChrootDirectory %h/data | + | ChrootDirectory %h |
ForceCommand internal-sftp | ForceCommand internal-sftp | ||
+ | </code> | ||
+ | |||
+ | Redémarrer le service **sshd** | ||
+ | |||
+ | <code bash> | ||
+ | sudo service sshd restart | ||
</code> | </code> | ||