This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| informatique:linux:openssh [2024/12/02 15:21] – yahiko | informatique:linux:openssh [2024/12/04 16:05] (current) – [Ce que j'ai réussi à faire fonctionner] yahiko | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Mémo configurations OpenSSH ====== | ====== Mémo configurations OpenSSH ====== | ||
| + | |||
| + | <WRAP center round alert 60%> | ||
| + | Gros brouillon, c'est un peu d'la daube. | ||
| + | </ | ||
| + | |||
| ===== Limiter les utilisateur SFTP avec Chroot Jail ===== | ===== Limiter les utilisateur SFTP avec Chroot Jail ===== | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | * https:// | ||
| - | Dans ''/ | + | ==== Ce que j'ai réussi à faire fonctionner ==== |
| - | Pour un groupe | + | <code bash> |
| + | addgroup sftpgroup | ||
| + | adduser --no-create-home UTILISATEUR | ||
| + | usermod -d / | ||
| + | usermod -s / | ||
| + | usermod -g sftpgroup UTILISATEUR | ||
| + | |||
| + | chown root / | ||
| + | chmod go-w / | ||
| + | mkdir / | ||
| + | chown utilisateur: | ||
| + | chmod ug+rwX / | ||
| + | </ | ||
| + | |||
| + | S'il s'agit du dossier d'un site web : | ||
| < | < | ||
| - | Match Group ftpgroup | + | usermod |
| - | ChrootDirectory / | + | |
| - | ForceCommand internal-sftp | + | |
| - | X11Forwarding no | + | |
| - | AllowTcpForwarding no | + | |
| </ | </ | ||
| - | Pour un utilisateur | + | Dans ''/ |
| < | < | ||
| - | Match User jeanmichel | + | # override default of no subsystems |
| - | ChrootDirectory | + | # |
| - | ForceCommand internal-sftp | + | Subsystem sftp internal-sftp |
| - | X11Forwarding | + | |
| + | Match User UTILISATEUR | ||
| + | ChrootDirectory | ||
| + | ForceCommand internal-sftp | ||
| + | PasswordAuthentication yes | ||
| + | PermitTunnel no | ||
| + | AllowAgentForwarding | ||
| AllowTcpForwarding no | AllowTcpForwarding no | ||
| + | X11Forwarding no | ||
| </ | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||