diff --git a/source/_posts/rsync-setup-nixos.md b/source/_posts/rsync-setup-nixos.md index 0b4401f..7b49fb5 100644 --- a/source/_posts/rsync-setup-nixos.md +++ b/source/_posts/rsync-setup-nixos.md @@ -37,8 +37,9 @@ Create a separate user with home folder set to where web server will be deployed www-data = { openssh.authorizedKeys.keys = [ "ssh-ed25519 ..." ]; home = "/var/www"; + # Remove this line after "/var/www" is created createHome = true; - ## Required for rsync + # Required for rsync useDefaultShell = true; }; }; @@ -53,6 +54,8 @@ Home folder is not world-readable by default, so if you start a web server using chmod +xr /var/www ``` +Make sure `users.users.www-data.createHome` setting is removed/disabled, otherwise `/var/www` will become non-world-readable after an upgrade. + ### Hide dotfiles in web server `useDefaultShell` grants a shell to the user and the shell may generate dotfiles to home folder (e.g. `~/.bash_history`/`~/.bashrc`). In practice, those files will be removed automatically every time rsync runs. As a precaution, you should configure the web server not to expose those dotfiles.