Skip to content

Instantly share code, notes, and snippets.

@Kiwi

Kiwi/vsftpd.nix Secret

Created May 25, 2020 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kiwi/6ba7542706c50c5c39d99f3d95206abf to your computer and use it in GitHub Desktop.
Save Kiwi/6ba7542706c50c5c39d99f3d95206abf to your computer and use it in GitHub Desktop.
nix config for vsftpd
{pkgs, ...}:
{
services.vsftpd = {
allowWriteableChroot = false;
anonymousMkdirEnable = true;
anonymousUmask = "077";
anonymousUploadEnable = true;
anonymousUser = false;
anonymousUserHome = "/home/ftp/";
anonymousUserNoPassword = false;
chrootlocalUser = false;
# enable = false;
enable = true;
enableVirtualUsers = false;
extraConfig =
''
listen_port=21
ftp_data_port=20
pasv_min_port=56250
pasv_max_port=56260
'';
forceLocalDataSSL = false;
forceLocalLoginsSSL = false;
localRoot = "/home/ftp/$USER";
localUsers = true;
portPromiscuous = false;
rsaCertFile = null;
rsaKeyFile = null;
ssl_sslv2 = true;
ssl_sslv3 = true;
ssl_tlsv1 = true;
userDbPath = null;
userlist = [ "kiwi" ];
userlistDeny = false;
userlistEnable = true;
# userlistFile =
# ''
# pkgs.writeText "userlist" (concatMapStrings (x: "${x}
# ") cfg.userlist)
# '';
virtualUseLocalPrivs = false;
# writeEnable = false;
writeEnable = true;
};
networking.firewall.allowedTCPPorts = [ 21 ];
networking.firewall.allowedTCPPortRanges = [ { from = 56250; to = 56260; } ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment