Setting Up a Secure SFTP Access with OpenSSH

SFTP (SSH File Transfer Protocol) is a secure method for transferring files over a network. Unlike FTP, all data, including credentials, is encrypted. Modern versions of OpenSSH include a built-in SFTP server, allowing you to set up restricted access for file transfers without needing a full SSH shell. This guide explains how to create a user limited exclusively to SFTP access and confined to their home directory (chroot). 1. Create a Dedicated Group It is recommended to create a specific group for SFTP users. This makes it easier to manage permissions and apply rules in the SSH configuration. ...

September 7, 2010 · 3 min · 528 words · oxomichael

Pure-FTPd and Virtual Users

Pure-FTPd is a secure and easy-to-configure FTP server. One of its most useful features is the management of virtual users. Unlike system users, virtual users exist only for the FTP service. They are stored in a dedicated database, which avoids creating real accounts on the operating system, thereby improving security. This guide will show you how to configure Pure-FTPd to use a virtual user database. 1. Virtual User Files The configuration of virtual users relies on two main files, usually located in /etc/pure-ftpd/: ...

July 14, 2010 · 3 min · 449 words · oxomichael

Convert a Directory to UTF-8 with PHP

It is sometimes necessary to convert the encoding of a large number of files, for example, when migrating an old project. UTF-8 encoding is the standard today, but many older files may use encodings like ISO-8859-1 or Windows-1252. Here is a modern, standalone PHP script that recursively scans a source directory, detects the encoding of each file, and converts it to UTF-8 in a destination directory. Unlike the old version that relied on shell commands (file, iconv), this script exclusively uses native PHP extensions (mbstring, SPL), making it more portable and reliable. ...

January 22, 2010 · 3 min · 434 words · oxomichael

Generate a password in PHP

Note de mise à jour (Juillet 2025) : Cet article est conservé pour l’archive. Les méthodes présentées ici (rand(), srand()) ne sont plus considérées comme sécurisées. Pour une approche moderne et sûre, veuillez consulter la version mise à jour de cet article : Générer un mot de passe sécurisé en PHP (Version 2025) La sécurisation d’un mot de passe dépend du nombre de caractères différents présent dans celui-ci. Voici une solution pour rendre les mots de passe sécurisé lors de leur génération: code : ...

February 23, 2007 · 3 min · 439 words · oxomichael