tech:monter_un_serveur_sftp_chroote_avec_openssh
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:monter_un_serveur_sftp_chroote_avec_openssh [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:monter_un_serveur_sftp_chroote_avec_openssh [2025/09/25 15:03] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 5: | Ligne 5: | ||
| Voir : https:// | Voir : https:// | ||
| - | Voir aussi : [[draft-monter-un-serveur-sftp-ssh|Monter un serveur SFTP avec ProFTPd]] | + | Voir aussi : |
| + | * [[draft-monter-un-serveur-sftp-ssh|Monter un serveur SFTP avec ProFTPd]] | ||
| + | * [[SSH SFTP chroot]] | ||
| <code bash> | <code bash> | ||
| Ligne 11: | Ligne 13: | ||
| chown root:nsc /chroot | chown root:nsc /chroot | ||
| chmod 750 /chroot | chmod 750 /chroot | ||
| + | |||
| useradd sftpuser -M -d /dev/null -s / | useradd sftpuser -M -d /dev/null -s / | ||
| + | # useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead. | ||
| + | |||
| echo "/ | echo "/ | ||
| </ | </ | ||
| Ligne 36: | Ligne 41: | ||
| systemctl status sshd | systemctl status sshd | ||
| </ | </ | ||
| + | |||
| + | |||
| + | == Autres | ||
| + | |||
| + | The simplest way is to create some script that would take care of that. Add | ||
| + | |||
| + | <code -> | ||
| + | Match User test1 | ||
| + | ForceCommand / | ||
| + | </ | ||
| + | And your script will basically run whatever the user wants, unless it is request for SFTP: | ||
| + | |||
| + | <code bash> | ||
| + | #!/bin/bash | ||
| + | if [[ " | ||
| + | echo "SFTP not allowed" | ||
| + | exit 255; | ||
| + | else | ||
| + | exec " | ||
| + | fi | ||
| + | </ | ||
| FIXME | FIXME | ||
tech/monter_un_serveur_sftp_chroote_avec_openssh.1742825205.txt.gz · Dernière modification : de 127.0.0.1
