1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741
|
<HTML
><HEAD
><TITLE
>Professional FTP Daemon FAQ</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.77+"></HEAD
><BODY
CLASS="BOOK"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="BOOK"
><A
NAME="AEN1"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="TITLE"
><A
NAME="AEN2"
></A
>Professional FTP Daemon FAQ</H1
><H3
CLASS="AUTHOR"
><A
NAME="AEN4"
></A
>Mark Lowes</H3
><DIV
CLASS="AFFILIATION"
><DIV
CLASS="ADDRESS"
><P
CLASS="ADDRESS"
><TT
CLASS="EMAIL"
><<A
HREF="mailto:hamster@vom.org.uk"
>hamster@vom.org.uk</A
>></TT
></P
></DIV
></DIV
><P
CLASS="COPYRIGHT"
>Copyright © 1999-2003 Mark Lowes</P
><DIV
CLASS="LEGALNOTICE"
><A
NAME="AEN15"
></A
><P
><B
>Copyrights and Trademarks</B
></P
><P
>This document may be reproduced in whole or in part, without fee,
subject to the following restrictions:</P
><P
></P
><OL
COMPACT="COMPACT"
TYPE="1"
><LI
><P
>The copyright notice above and this permission notice must be
preserved complete on all complete or partial copies</P
></LI
><LI
><P
>Any translation or derived work must be approved by the author in
writing before distribution.</P
></LI
><LI
><P
>If you distribute this work in part, instructions for obtaining
the complete version of this manual must be included, and a means
for obtaining a complete version provided.</P
></LI
><LI
><P
>Small portions may be reproduced as illustrations for reviews or
quotes in other works without this permission notice if proper
citation is given.</P
></LI
></OL
><P
>Exceptions to these rules may be granted for academic purposes:
Write to the author and ask. These restrictions are here to protect us
as authors, not to restrict you as learners and educators. </P
></DIV
><HR></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="#AEN29"
>Preface</A
></DT
><DT
>1. <A
HREF="#AEN33"
>Introduction to ProFTPD</A
></DT
><DT
>2. <A
HREF="#AEN163"
>Compilation and installing</A
></DT
><DT
>3. <A
HREF="#AEN239"
>Compatibility and Integration</A
></DT
><DT
>4. <A
HREF="#AEN288"
>Common Running problems</A
></DT
><DT
>5. <A
HREF="#AEN553"
>Configuration problems</A
></DT
><DT
>6. <A
HREF="#AEN727"
>Security</A
></DT
><DT
>7. <A
HREF="#AEN813"
>User Authentication</A
></DT
><DT
>8. <A
HREF="#AEN924"
>FAQ Notes</A
></DT
></DL
></DIV
><DIV
CLASS="PREFACE"
><HR><H1
><A
NAME="AEN29"
></A
>Preface</H1
><BLOCKQUOTE
CLASS="ABSTRACT"
><DIV
CLASS="ABSTRACT"
><A
NAME="AEN31"
></A
><P
></P
><P
>This document sets out many of the FAQs related to the installation,
functioning and configuration of ProFTPD. It also provides some guidance
on policy and security issues.</P
><P
></P
></DIV
></BLOCKQUOTE
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="AEN33"
></A
>Chapter 1. Introduction to ProFTPD</H1
><DIV
CLASS="QANDASET"
><DL
><DT
>1. <A
HREF="#AEN37"
>What is ProFTPD?</A
></DT
><DT
>2. <A
HREF="#AEN42"
>What is the current version?</A
></DT
><DT
>3. <A
HREF="#AEN50"
>Version numbering scheme</A
></DT
><DT
>4. <A
HREF="#AEN77"
>Website & documentation</A
></DT
><DT
>5. <A
HREF="#AEN89"
>Bug reporting</A
></DT
><DT
>6. <A
HREF="#AEN95"
>I've found a security hole</A
></DT
><DT
>7. <A
HREF="#AEN103"
>Downloading</A
></DT
><DT
>8. <A
HREF="#AEN118"
>Mailing lists</A
></DT
><DT
>9. <A
HREF="#AEN159"
>Copyright Issues</A
></DT
></DL
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN37"
></A
><B
>1. </B
>What is ProFTPD?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>ProFTPD is a ftp server primarily written for the
various unix variants however it will compile under Cygwin
giving some support on Windows platforms. It has been
designed to be much like Apache in concept taking many
of the ideas (configuration format, modular design, etc)
from it.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN42"
></A
><B
>2. </B
>What is the current version?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Stable: 1.2.9</P
><P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
>Release Candidate: -none-</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN50"
></A
><B
>3. </B
>Version numbering scheme</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>At the moment there is a little irrationality in the numbering scheme however it can be summarised as follows</P
><A
NAME="AEN54"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>1.0.x</DT
><DD
><P
>This is the previous stable version.</P
></DD
><DT
>1.1.x</DT
><DD
><P
>Development code</P
></DD
><DT
>1.2.0rcx</DT
><DD
><P
>Release candidate code, these releases are
pretty much bug free and are testing releases prior
to the final stable code.</P
></DD
><DT
>1.2.x</DT
><DD
><P
>This will be the stable cycle with the final .x
being the incremental patches to fix bugs discovered
after the release version is issued.</P
></DD
><DT
>1.3.x</DT
><DD
><P
>1.3.x is the planned development tree, work
on this has been pushed back while more active
development of 1.2.x is undertaken.
</P
></DD
></DL
></DIV
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN77"
></A
><B
>4. </B
>Website & documentation</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
><A
HREF="http://www.proftpd.org/"
TARGET="_top"
>http://www.proftpd.org/</A
>
is the primary source for all information about the
project including documentation and security alerts.
There are a number of geographic mirror sites,
see the mirror pages on www.proftpd.org for more
details or try www.<isocode>.proftpd.org (ie
www.uk.proftpd.org).</P
><A
NAME="AEN82"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN83"
></A
>Helping with documentation</H3
><P
>Writing documentation is time consuming and requires
some work but it's not actually difficult. Look through the
directive list shipped with the source and package builds
of ProFTPD and see what needs work. Check the source code
to ensure that the context is correct by grepping through
the source code looking for something like</P
><PRE
CLASS="PROGRAMLISTING"
>CHECK_CONF(cmd,CONF_ROOT|CONF_VIRTUAL|CONF_ANON|CONF_GLOBAL)
</PRE
><P
>to figure out where the directive is valid
(server config, <VirtualHost>, <Anonymous>,
<Global> for the above example). Once you think you
understand what it does, test, play, break (if possible).
</P
><P
> Then either submit a plain text update via the bug reporting
system or a patch against the docbook/sgml source (available
from CVS on sourceforge (Project: pdd)
</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN89"
></A
><B
>5. </B
>Bug reporting</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Bug reports should be made via <A
HREF="http://bugs.proftpd.org/"
TARGET="_top"
>http://bugs.proftpd.org/</A
>
which uses the bugzilla tracking system. Patches should be
attached to the appropriate bug and not mailed directly to
the mailing lists or any given team member.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN95"
></A
><B
>6. </B
>I've found a security hole</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Please report all security problems with the code to
<TT
CLASS="EMAIL"
><<A
HREF="mailto:security@proftpd.org"
>security@proftpd.org</A
>></TT
> before releasing the information into the public
domain. It would be appreciated if you give the core team a few days
to put together a patch and/or new release to address the issue.</P
><P
>Please adhere to the proceedures and timescales given in the RF
Policy document <A
HREF="http://www.wiretrip.net/rfp/policy.html"
TARGET="_top"
>http://www.wiretrip.net/rfp/policy.html</A
>, this will give the core development team a chance to get a fix or workaround in place before the problem becomes fully public domain.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN103"
></A
><B
>7. </B
>Downloading</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There are two main methods of getting the software. Downloading a
compressed tarball or rpm (there is also a Debian package available in the main distribution) from proftpd.org or from a mirror site, alternatively if you wish to run the latest bleeding edge code then collecting from the cvs server is the best method.</P
><A
NAME="AEN107"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN108"
></A
>Mirror sites</H3
><P
>There is a complete and maintained list of ftp mirror sites available
from <A
HREF="http://www.proftpd.org/download.html"
TARGET="_top"
>http://www.proftpd.org/download.html</A
></P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN111"
></A
>CVS</H3
><P
> cvs -d :pserver:anonymous@cvs.proftp.sourceforge.net:/cvsroot/proftp
login (Hit Enter when prompted for a password.)</P
><P
>Then do:</P
><P
>cvs -d :pserver:anonymous@cvs.proftp.sourceforge.net:/cvsroot/proftp -z3 co proftpd</P
><P
>To obtain the latest/greatest updates, just hop into the
proftpd directory and do: cvs update</P
><P
>A couple of sites generate downloadable tarballs of the latest CVS
code to make obtaining the test code easier.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN118"
></A
><B
>8. </B
>Mailing lists</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There are a number of mailing lists for ProFTPD</P
><A
NAME="AEN122"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN123"
></A
>Announce</H3
><P
>proftpd-announce@proftpd.org</P
><P
>This is a very low traffic list where only ProFTPD announcements/changes
will be announced. Subscribe by sending a message to <TT
CLASS="EMAIL"
><<A
HREF="mailto:proftpd-announce-request@proftpd.org"
>proftpd-announce-request@proftpd.org</A
>></TT
> with
"subscribe" in the subject.</P
><P
>Web interface:
<A
HREF="https://lists.sourceforge.net/lists/listinfo/proftp-announce"
TARGET="_top"
> https://lists.sourceforge.net/lists/listinfo/proftp-announce
</A
>
</P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN129"
></A
>Users</H3
><P
>proftp-user@proftpd.org</P
><P
>This is intended to the the user support channel for the software,
in most likelihood this is going to be a high traffic list and
slightly chatty. Please read the FAQ, the documentation and the list
archives before posting a question.</P
><P
>Subscribe by sending a message to <TT
CLASS="EMAIL"
><<A
HREF="mailto:proftpd-user-request@proftpd.org"
>proftpd-user-request@proftpd.org</A
>></TT
> with
"subscribe" in the subject.</P
><P
>Web interface: <A
HREF="https://lists.sourceforge.net/lists/listinfo/proftp-user"
TARGET="_top"
>https://lists.sourceforge.net/lists/listinfo/proftp-user</A
></P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN136"
></A
>Development</H3
><P
>proftpd-devel@proftpd.org</P
><P
>This list is intended for discussion of development-related issues
of ProFTPD, and feature design. It is NOT intended to be a "user
help" group.</P
><P
>Subscribe by sending a message to <TT
CLASS="EMAIL"
><<A
HREF="mailto:proftpd-devel-request@proftpd.org"
>proftpd-devel-request@proftpd.org</A
>></TT
>
with "subscribe" in the subject.</P
><P
>Web interface:
<A
HREF="https://lists.sourceforge.net/lists/listinfo/proftp-devel"
TARGET="_top"
> https://lists.sourceforge.net/lists/listinfo/proftp-devel
</A
>
</P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN143"
></A
>Archives</H3
><P
>The mailing list archives can be found at:</P
><P
></P
><UL
><LI
><P
><A
HREF="http://www.proftpd.org/proftpd-announce-archive/"
TARGET="_top"
> http://www.proftpd.org/proftpd-announce-archive/</A
></P
></LI
><LI
><P
><A
HREF="http://www.proftpd.org/proftpd-l-archive/"
TARGET="_top"
> http://www.proftpd.org/proftpd-l-archive/</A
></P
></LI
><LI
><P
><A
HREF="http://www.proftpd.org/proftpd-devel-archive/"
TARGET="_top"
> http://www.proftpd.org/proftpd-devel-archive/</A
></P
></LI
></UL
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN155"
></A
>Unsubscribing</H3
><P
>Before posting to any of the lists or mailing the list admins
please try and remove yourself first. Either by emailing
<listname>-request@lists.sourceforge.net with the subject "unsubscribe" or
visiting the web interface and unsubscribing from there.</P
><P
>I've (lost / never had) a password to the interface. Easy,
enter the address you are subscribed to the list as into the form and
hit the "email me my password" button.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN159"
></A
><B
>9. </B
>Copyright Issues</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The software is currently distributed under the GNU General Public License
(version 2 or later) as published by the Free Software Foundation.
Copyright is held by Public Flood Software.</P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="AEN163"
></A
>Chapter 2. Compilation and installing</H1
><DIV
CLASS="QANDASET"
><DL
><DT
>1. <A
HREF="#AEN167"
>What platforms will it compile on?</A
></DT
><DT
>2. <A
HREF="#AEN193"
>Why not libc5 on Linux?</A
></DT
><DT
>3. <A
HREF="#AEN198"
>CVS</A
></DT
><DT
>4. <A
HREF="#AEN210"
>How do I get debug output</A
></DT
><DT
>5. <A
HREF="#AEN217"
>Patches</A
></DT
><DT
>6. <A
HREF="#AEN224"
>Using non-default modules</A
></DT
><DT
>7. <A
HREF="#AEN230"
>Microsoft platform support</A
></DT
><DT
>8. <A
HREF="#AEN235"
>New features/modules</A
></DT
></DL
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN167"
></A
><B
>1. </B
>What platforms will it compile on?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There have been reports of ProFTPD compiling on all the following
platforms (and versions).</P
><P
></P
><UL
><LI
><P
>Linux 2.0.x & 2.2.x (glibc 2.x only) & 2.4.x</P
></LI
><LI
><P
>BSDI 3.1 & 4.0</P
></LI
><LI
><P
>IRIX 6.2, 6.3, 6.4, 6.5</P
></LI
><LI
><P
>Solaris 2.5.1, 2.6, 2.7, 8 (Sparc)</P
></LI
><LI
><P
>AIX 3.2 & 4.2</P
></LI
><LI
><P
>OpenBSD 2.2/2.3</P
></LI
><LI
><P
>FreeBSD 2.2.7</P
></LI
><LI
><P
>Digital UNIX 4.0A</P
></LI
><LI
><P
>DEC OFS/1</P
></LI
><LI
><P
>Cygwin</P
></LI
></UL
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN193"
></A
><B
>2. </B
>Why not libc5 on Linux?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There are several known problems with libc5-based
systems, including improperly implemented library routines
(vsprintf and vsnprintf are examples). There are known
problems with the resolver library. For these reasons
and others lib5 is not being supported at all, the latest
versions of the major distributions (inc Debian, Redhat and
Suse) are all glibc. </P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN198"
></A
><B
>3. </B
>CVS</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>CVS (Concurrent Versions System), is a version control system which
allows multiple developers (scattered across the same room or across
the world) to maintain a single codebase and keep a record of all
changes to the work.</P
><P
>The CVS repository for ProFTPD is available for non-developers in
read-only mode, however this code is right on the bleeding edge and is
not guaranteed to even compile let alone work. Access to CVS is given
to allow important security patches out into the wild and to allow
users and interested users to test out the latest changes on real
systems. </P
><P
>Nightly tarballs of the current CVS are available on
ftp.proftpd.org, these are built at approx 1am UK time.</P
><A
NAME="AEN204"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN205"
></A
>Recommended ~/.cvsrc settings</H3
><PRE
CLASS="PROGRAMLISTING"
>cvs -z 3
update -Pd
diff -u
</PRE
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN207"
></A
>Where can I get information on cvs?</H3
><P
>CVS is produced by Cyclic Software (http://www.cyclic.com/) and
details on CVS can be found on their website. The CVS documentation
is clear, detailed and above all heavy when printed. I'd recommend
reading it if you're planning on using CVS a lot.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN210"
></A
><B
>4. </B
>How do I get debug output</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The easiest way is to fire up proftpd manually from the command
line with the debug level cranked up.</P
><PRE
CLASS="PROGRAMLISTING"
>/usr/local/sbin/proftpd -d9 -n
</PRE
><P
>This will result in maximal debug output direct to the
console. Warning, this can get messy on a busy server, for testing I
would suggest copying the config and altering the port the server
binds to and then testing.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN217"
></A
><B
>5. </B
>Patches</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Any patches should be submitted in Universal format, this makes
integrating them into the main cvs source a lot easier. When
generating a diff against the current cvs source use "cvs diff -uw" to
generate the patch.</P
><PRE
CLASS="PROGRAMLISTING"
>cvs diff -u filename > filename.patch
or
cvs diff -u > bigger.patch
</PRE
><P
>Patches that add configuration directives without proper
documentation. Will be rejected. New features without documentation
are less than useless to the community at large.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN224"
></A
><B
>6. </B
>Using non-default modules</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Simply configure ProFTPD with </P
><PRE
CLASS="PROGRAMLISTING"
>./configure --with-modules=mod_module1:mod_module2:mod_module3
make
make install
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN230"
></A
><B
>7. </B
>Microsoft platform support</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There are no current plans for a direct port to any MS platform.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN235"
></A
><B
>8. </B
>New features/modules</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>While anything new is welcomed it's probably better
to at least float the idea first on the devel mailing list
to ensure that someone else isn't already hacking on it.
Also when submitting the patch or module for inclusion into
the ProFTPD source full documentation is needed.</P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="AEN239"
></A
>Chapter 3. Compatibility and Integration</H1
><DIV
CLASS="QANDASET"
><DL
><DT
>1. <A
HREF="#AEN243"
>SQL</A
></DT
><DT
>2. <A
HREF="#AEN248"
>SSH</A
></DT
><DT
>3. <A
HREF="#AEN254"
>sendfile()</A
></DT
><DT
>4. <A
HREF="#AEN270"
>IPv6</A
></DT
><DT
>5. <A
HREF="#AEN276"
>Filename case sensitivity</A
></DT
><DT
>6. <A
HREF="#AEN281"
>FXP</A
></DT
></DL
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN243"
></A
><B
>1. </B
>SQL</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>ProFTPD has support for authentication and logging via SQL
databases using the mod_sql module as supplied in the main
distribution.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN248"
></A
><B
>2. </B
>SSH</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There is a mini-HOWTO at <A
HREF="http://www.castaglia.org/proftpd/doc/"
TARGET="_top"
>http://www.castaglia.org/proftpd/doc/</A
> detailing how to tunnel ftp connections over ssh.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN254"
></A
><B
>3. </B
>sendfile()</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>sendfile() is a system call which streamlines the copying of data
between the disk and the tcp socket. The call copied from the page
cache directly rather than requiring a kernel -> user space -> kernel
space copy for every read() and write() call. Generally the
advantages are only felt on heavily loaded servers. The call is
supported in ProFTPD for Linux and FreeBSD.</P
><A
NAME="AEN258"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN259"
></A
>Linux 2.0.x</H3
><P
>sendfile is not supported under 2.0.x, this is not an issue when
compiling for 2.0.x on a 2.0.x system. However when compiling on a
2.2.x system for use on 2.0.x use the --disable-sendfile flag.</P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN261"
></A
>Runtime detection of sendfile()</H3
><P
>Johnie Ingram (aka netgod)'s:
<A
HREF="http://www.proftpd.org/proftpd-devel-archive/99-10/msg00073.html"
TARGET="_top"
>http://www.proftpd.org/proftpd-devel-archive/99-10/msg00073.html</A
></P
><P
>John Pierce <hawkfan@pyrotechnics.com>
<A
HREF="http://www.proftpd.org/proftpd-devel-archive/99-10/msg00112.html"
TARGET="_top"
>http://www.proftpd.org/proftpd-devel-archive/99-10/msg00112.html</A
></P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN266"
></A
>Problems with sendfile</H3
><P
>There appear to be a number of problems with sendfile()
particularly with the directives and features which require accurate
determination of filesize. Such as the Rate* functions and
downloading large files, the best advice at the moment appears to be
to disable sendfile by default ( --disable-sendfile ).</P
><P
>Sendfile() also appears to be the source of a number of file corruption problems.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN270"
></A
><B
>4. </B
>IPv6</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There is currently no official support for IPv6 within the 1.2.x
code tree, however there is an <A
HREF="http://www.t17.ds.pwr.wroc.pl/~misiek/ipv6/"
TARGET="_top"
>http://www.t17.ds.pwr.wroc.pl/~misiek/ipv6/</A
> and more comprehensive support will probably be developed
during the 1.3.x development cycle.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN276"
></A
><B
>5. </B
>Filename case sensitivity</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>ProFTPD is utterly dependant on the underlying OS to handle
filename case sensitivity. If the underlying OS is case sensitive
then ProFTPD will be, there are currently no plans for a module to
handle this.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN281"
></A
><B
>6. </B
>FXP</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>FXP is capable of bouncing data between websites. There have been
a number of reports of problems in configuring ProFTPD to function
cleanly with this program (http://flashfxp.skuz.net/).</P
><P
>To support FXP when connecting as a user place "AllowForeignAddress
on" in the Global or VirtualHost context.</P
><P
>To support FXP when connecting as anon "AllowForeignAddress on"
must be placed in the Anonymous context.</P
><P
>The config will happily support "AllowForeignAddress on" in
multiple places within the config.</P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="AEN288"
></A
>Chapter 4. Common Running problems</H1
><DIV
CLASS="QANDASET"
><DL
><DT
>1. <A
HREF="#AEN292"
>ProFTPD doesn't seem to work.</A
></DT
><DT
>2. <A
HREF="#AEN325"
>"inet_create_connection() failed: Operation not permitted".</A
></DT
><DT
>3. <A
HREF="#AEN330"
>Unable to bind to port/Address already in use</A
></DT
><DT
>4. <A
HREF="#AEN339"
>"(Login failed): Invalid shell"</A
></DT
><DT
>5. <A
HREF="#AEN345"
>"Fatal: Socket operation on non-socket"</A
></DT
><DT
>6. <A
HREF="#AEN351"
>"Fatal: unable to determine IP address of "hostname:</A
></DT
><DT
>7. <A
HREF="#AEN356"
>I'm having problems with FTP clients behind firewalls</A
></DT
><DT
>8. <A
HREF="#AEN367"
>Can I run more that one VirtualHost on a single IP?</A
></DT
><DT
>9. <A
HREF="#AEN377"
>How do I run ProFTPD from inetd?</A
></DT
><DT
>10. <A
HREF="#AEN388"
>Can I use tcp-wrappers with ProFTPD?</A
></DT
><DT
>11. <A
HREF="#AEN394"
>Can I run an FTP server on a non-standard port?</A
></DT
><DT
>12. <A
HREF="#AEN400"
>Can control upload/download ratios?</A
></DT
><DT
>13. <A
HREF="#AEN413"
>Slow logins</A
></DT
><DT
>14. <A
HREF="#AEN420"
>Lots of "FTP session closed" messages</A
></DT
><DT
>15. <A
HREF="#AEN427"
>How do I see who is connected?</A
></DT
><DT
>16. <A
HREF="#AEN432"
>Can I force ProFTPD to listen on only one IP?</A
></DT
><DT
>17. <A
HREF="#AEN445"
>"FTP server shut down ... please try again later."</A
></DT
><DT
>18. <A
HREF="#AEN450"
>How do I shutdown the server without killing proftpd?</A
></DT
><DT
>19. <A
HREF="#AEN455"
>Is is possible to shutdown a single VirtualHost?</A
></DT
><DT
>20. <A
HREF="#AEN460"
>Error 421</A
></DT
><DT
>21. <A
HREF="#AEN477"
>proftpd doesn't show in the processlist</A
></DT
><DT
>22. <A
HREF="#AEN482"
>How do I restart/reload the server?</A
></DT
><DT
>23. <A
HREF="#AEN492"
>503 No PORT command issued</A
></DT
><DT
>24. <A
HREF="#AEN497"
>Fatal: unable to determine IP address of</A
></DT
><DT
>25. <A
HREF="#AEN502"
>451 append/restart not permitted, try again</A
></DT
><DT
>26. <A
HREF="#AEN507"
>501 REST not compatible with server configuration</A
></DT
><DT
>27. <A
HREF="#AEN512"
>The time being displayed is wrong</A
></DT
><DT
>28. <A
HREF="#AEN518"
>Authentication is taking too long</A
></DT
><DT
>29. <A
HREF="#AEN523"
>Corrupted files</A
></DT
><DT
>30. <A
HREF="#AEN528"
>Can I upgrade ProFTPD without terminating the current sessions?</A
></DT
><DT
>31. <A
HREF="#AEN533"
>No such group "nogroup"</A
></DT
><DT
>32. <A
HREF="#AEN538"
>Why do I see "unable to set groups: Invalid argument"? </A
></DT
><DT
>33. <A
HREF="#AEN547"
>Why do I see error messages like these when I logout?</A
></DT
></DL
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN292"
></A
><B
>1. </B
>ProFTPD doesn't seem to work.</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Starting ProFTPD in standalone mode it doesn't show in "ps" It
could be many things, possibly something like not running ProFTPD as
root (it needs to be run as root initially, but will switch to a
non-privileged user). Regardless, ProFTPD logs all errors via the
standard syslog mechanism. You need to check your system logs in order
to determine what the problem is.</P
><A
NAME="AEN296"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN297"
></A
>It doesn't work!</H3
><P
>There are many times when there's a completely random problem which
appears to be insoluble. The best place to ask for help is definately
the mailing list (proftpd-l) but it's not productive to ask for help
without giving enough information for intelligent debugging.</P
><P
>Have you?</P
><P
></P
><UL
><LI
><P
>Checked your logs</P
></LI
><LI
><P
>Tried the server in debug mode</P
></LI
><LI
><P
>Read the FAQ?</P
></LI
><LI
><P
>Checked the mailing list archive?</P
></LI
><LI
><P
>Are you running the latest version?</P
></LI
></UL
></BLOCKQUOTE
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>When posting try giving enough information, this might include but
not be limited to.</P
><P
></P
><UL
><LI
><P
>OS and server version (proftpd -vv)</P
></LI
><LI
><P
>List of included modules (proftpd -l)</P
></LI
><LI
><P
>Appropriate log extracts</P
></LI
><LI
><P
>Output fom debug mode</P
></LI
><LI
><P
>Configration fragment</P
></LI
></UL
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN325"
></A
><B
>2. </B
>"inet_create_connection() failed: Operation not permitted".</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>You aren't starting ProFTPD as root, or you have inetd configured
to run ProFTPD as a user other than root. The ProFTPD daemon must be
started as root in order to bind to tcp ports lower than 1024, or to
open your shadow password file when authenticating users. The daemon
switches uid/gids to the user and group specified by the User/Group
directives during normal operation, so a "ps" will show it running as
the user you specified.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN330"
></A
><B
>3. </B
>Unable to bind to port/Address already in use</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>0.0.0.0 is INADDR_ANY, which means to bind to any interface. The
"address in use" will normally mean that something has already bound
to that address.</P
><P
>Under linux it is possible to run:</P
><PRE
CLASS="PROGRAMLISTING"
>fuser -n tcp 21
</PRE
><P
>to get the PID of the process currently bound to port ProFTPD is
configured to run as.</P
><P
>The most common cause is that ProFTPD is configured standalone and
inetd is still configured for port 21. Comment out the line starting
"ftp" in /etc/inetd.conf and restart (killall -HUP inetd or something
similar should do the trick) and try again. </P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN339"
></A
><B
>4. </B
>"(Login failed): Invalid shell"</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The user attempting to login has been given a shell that is
not listed in the system's /etc/shells file. By default, proftpd will require
that users logging in have valid shells. Use the RequireValidShell directive
to turn off this requirement:</P
><PRE
CLASS="PROGRAMLISTING"
>RequireValidShell off
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN345"
></A
><B
>5. </B
>"Fatal: Socket operation on non-socket"</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>You have ProFTPD configured to run in inetd mode rather than
standalone. In this mode, ProFTPD expects that it will be run from the
inetd super-server, which implies that stdin/stdout will be sockets
instead of terminals. As a result, socket operations will fail and the
above error will be printed. If you wish to run ProFTPD from the
shell, in standalone mode, you'll need to modify your proftpd.conf
configuration file and add or edit the ServerType directive to read:</P
><PRE
CLASS="PROGRAMLISTING"
>ServerType standalone
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN351"
></A
><B
>6. </B
>"Fatal: unable to determine IP address of "hostname:</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The hosting machine has a poorly configured hostname setup to the
point where the resolver library cannot determine the IP from the
name. Solutions include, fixing the DNS for the domain, fixing the
hostname, fixing the /etc/hosts file. Which one works for you will
largely depend on your OS and exactly what is wrong.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN356"
></A
><B
>7. </B
>I'm having problems with FTP clients behind firewalls</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The FTP Specification defines that two sockets should be used for
all communications. The first runs over port 21 and is the control
channel over which all commands and response codes are sent. Whenever
data is required to be transfered, for example for a file download, a
directory listing etc etc. A second channel is created on demand,
this socket can take one of two forms.</P
><A
NAME="AEN360"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN361"
></A
>non-Passive</H3
><P
>The server end of the data socket uses port 20. This is nice and
easy to work into a firewall configuration.</P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN363"
></A
>Passive</H3
><P
>The port at either end is dynamically allocated. This is virtually
impossible to cater for in a firewall configuration given that the
port mapping will be different for every data connection.</P
><P
>The solution is to force the users to configure their clients to
use the non-passive mode (ie port 20)</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN367"
></A
><B
>8. </B
>Can I run more that one VirtualHost on a single IP?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>No, or at least not in the HTTP/1.1 manner of virtual hosting.
This is an inbuilt limitation of the current FTP RFC., unlike the
HTTP/1.1 spec there is no mechanism comparable to the "Host:
foo.bar.com" HTTP header for specifying which host the connection is
for. Therefore the only method for determining which VirtualHost the
connection is destined for is by the destination IP.</P
><P
>The one exception to this is if you host multiple servers on the same
IP but using different ports, however this requires that the connecting
client uses a non-standard port and therefore is probably not a good
solution for mass hosting.</P
><A
NAME="AEN372"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN373"
></A
>Is there anything in the pipeline to fix this?</H3
><P
>There is a draft standard <A
HREF="http://search.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-12.txt"
TARGET="_top"
>http://search.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-12.txt</A
> with the IETF which extends and improves on the FTP specification including support for a HOST command. However given that the IP crunch is coming from websites and not virtual ftp servers this is unlikely to be pushed through any time soon.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN377"
></A
><B
>9. </B
>How do I run ProFTPD from inetd?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Find the line in /etc/inetd.conf that looks something like this:</P
><A
NAME="AEN381"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
>ftp stream tcp nowait root in.ftpd in.ftpd</P
></BLOCKQUOTE
><P
>Replace it with:</P
><A
NAME="AEN384"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
>ftp stream tcp nowait root in.proftpd in.proftpd</P
></BLOCKQUOTE
><P
>Then, find your inetd process in the process listing and send it
the SIGHUP signal so that it will rehash and reconfigure itself. You
may also need to add in.ProFTPD to hosts.allow on your system.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN388"
></A
><B
>10. </B
>Can I use tcp-wrappers with ProFTPD?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Yup. Although ProFTPD has built-in IP access control (see the Deny
and Allow directives), many admins choose to consolidate IP access
control in one place via in.tcpd. Just configure ProFTPD to run from
inetd as any other tcp-wrapper wrapped daemon and add the
appropriate lines to hosts.allow/deny files.</P
><P
>If running ProFTPD in standalone mode, mod_wrap can be used to direct the
server to use the normal hosts.allow/deny files.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN394"
></A
><B
>11. </B
>Can I run an FTP server on a non-standard port?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Yes. Use a <VirtualHost> block with your machine's FQDN
(Fully Qualified Domain Name) or IP address, and a Port directive
inside the <VirtualHost> block. For example, if your host is
named "myhost.mydomain.com" and you want to run an additional FTP
server on port 2001, you would:</P
><PRE
CLASS="PROGRAMLISTING"
>...
<VirtualHost myhost.mydomain.com>
Port 2001
...
</VirtualHost>
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN400"
></A
><B
>12. </B
>Can control upload/download ratios?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Yes the mod_ratio module provides for doing just this.</P
><P
>The ratio directives take four numbers: file ratio, initial file
credit, byte ratio, and initial byte credit. Setting either ratio
to 0 disables that check.</P
><P
>The directives are HostRatio (matches FQDN, wildcards allowed),
AnonRatio (matches password entered at login), UserRatio (accepts "*"
for "any user"), and GroupRatio. </P
><PRE
CLASS="PROGRAMLISTING"
>Ratios on # enable module
UserRatio ftp 0 0 0 0
HostRatio master.debian.org 0 0 0 0 # leech access (default)
GroupRatio proftpd 100 10 5 100000 # 100:1 files, 10 file cred 5:1 bytes, 100k byte cred
AnonRatio billg@microsoft.com 1 0 1 0 # 1:1 ratio, no credits
UserRatio * 5 5 5 50000 # special default case
</PRE
><P
>This example is for someone who (1) has downloaded 1 file of 82k,
(2) has uploaded nothing, (3) has a ratio of 5:1 files and 5:1
bytes, (4) has 4 files and 17k credit remaining, and (5) is now
changing directory to /art/nudes/young/carla. The initial credit,
not shown, was 5 files and 100k (UserRatio * 5 5 5 100000).</P
><P
>Version 2.0 and above of this module integrate with mod_sql.</P
><A
NAME="AEN409"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN410"
></A
>Limitations of mod_ratio</H3
><P
>It appears that the ratio limits in mod_ratio are only maintained
on a per session basis and there is no ongoing tracking of usage.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN413"
></A
><B
>13. </B
>Slow logins</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>This is probably caused by a firewall or DNS timeout. By default
ProFTPD will try to do both DNS and ident lookups against the incoming
connection. If these are blocked or excessively delayed a slower than
normal login will result. To turn off DNS and ident use:</P
><PRE
CLASS="PROGRAMLISTING"
>UseReverseDNS off
IdentLookups off
</PRE
><P
>IdentLookups and tcpwrappers
***</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN420"
></A
><B
>14. </B
>Lots of "FTP session closed" messages</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Oct 7 12:30:48 salvage2 proftpd[8874]: FTP session closed.
Oct 7 12:30:48 salvage2 proftpd[8874]: FTP session closed.
Oct 7 12:30:48 salvage2 proftpd[8874]: FTP session closed.
Oct 7 12:30:48 salvage2 proftpd[8874]: FTP session closed.
</P
><P
>The above log extract is likely to be caused by a local monitoring
system or a particularly aggressive DoS attack. Most service
monitoring systems try opening the ftp port on the target server to
detect whether it is active and running. Most of the time these tests
are followed by an immediate "QUIT" or disconnection.</P
><P
>TCPdump/TCPshow on the server in question should show which machine
on your network is is generating these connections.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN427"
></A
><B
>15. </B
>How do I see who is connected?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The ftpwho command lists the state of each ftp connection to the
server and what it's current activity is. However this does not
detail the connection information on a virtual by virtual basis.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN432"
></A
><B
>16. </B
>Can I force ProFTPD to listen on only one IP?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Sort, of it's not quite as clean as the socket binding under Apache
but the principle works something like this.</P
><A
NAME="AEN436"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN437"
></A
>Standalone mode</H3
><P
>To listen on the primary IP of a host use the SocketBindTight directive</P
><P
>To listen on a interfaces which are not the primary host interface use the SocketBindTight directive, place your server configuration in a <VirtualHost ftp.mydomain.com> block and use "Port 0" for the main host configuration and and "Port 21" inside the VirtualHost block.</P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN440"
></A
>inetd</H3
><P
>There are two approaches possible, the first is to use the patch
from Daniel Roesen <droesen@entire-systems.com> (check
the mailing list archives).</P
><P
>The second method is to run ProFTPD from xinetd
(http://synack.net/xinetd/), a more advanced replacement of inetd. An
entry for this in xinetd.conf would be something like this:</P
><PRE
CLASS="PROGRAMLISTING"
>service ftp
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/proftpd
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
#bind = [IP to bind to]
}
</PRE
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN445"
></A
><B
>17. </B
>"FTP server shut down ... please try again later."</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Check for /etc/shutmsg and delete it.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN450"
></A
><B
>18. </B
>How do I shutdown the server without killing proftpd?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>ftpshut, allows the server to disallow connections with a message
without actually taking down the service. The shutdown can be
scheduled for a point in the future or right now, existing connections
can be allowed to finish, or be terminated now. Re-enabling is done
by removing the /etc/shutmsg file.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN455"
></A
><B
>19. </B
>Is is possible to shutdown a single VirtualHost?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>No, the shutmsg file works at a daemon level not at a virtual host
level.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN460"
></A
><B
>20. </B
>Error 421</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>This appears to be a general catch all error code meaning "something
nasty has gone wrong".</P
><P
></P
><UL
><LI
><P
>Connection has timed out</P
></LI
><LI
><P
>The DefaultRoot specified doesn't exist</P
></LI
><LI
><P
>The parent server has been killed</P
></LI
><LI
><P
>Check /etc/services</P
></LI
><LI
><P
>Wrong permissions on the DefaultRoot</P
></LI
></UL
><P
>You get the idea...</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN477"
></A
><B
>21. </B
>proftpd doesn't show in the processlist</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Two possible reasons, first that it's simply not running, try
proftpd -n -d2 to run in debug mode and see what happens. The other
is that it's running from inetd and there are no active sessions at
the moment.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN482"
></A
><B
>22. </B
>How do I restart/reload the server?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>This depends on the mode you're running the server in.</P
><A
NAME="AEN486"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN487"
></A
>inetd</H3
><P
>Unless you're making a configuration change to inetd itself nothing
needs doing. The server reloads the configuration everytime a new
connection is made.</P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN489"
></A
>Standalone</H3
><P
>Either stop and start the server completely (a little aggressive
for most admins tastes) or send a SIGHUP to the master daemon
process.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN492"
></A
><B
>23. </B
>503 No PORT command issued</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>A bug was introduced in 1.2.0rc2 which prevented the PORT command
working properly and therefore breaking the data socket under certain
conditions. The bug was documented as bug 240 and has been fixed in
CVS. A rc3 release is due before the end of Jan 2001.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN497"
></A
><B
>24. </B
>Fatal: unable to determine IP address of</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Proftpd was unable to work out what IP is associated with the
hostname in the VirtualHost block. Normally caused by a problem
with the DNS resolution of the host, check the resolv.conf file
and that your chosen nameservers are functional.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN502"
></A
><B
>25. </B
>451 append/restart not permitted, try again</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>AllowStoreRestart is disabled by default because it will allow any
writable file to be corrupted by a malicious user. It is recommended
that this option is only used with authenticated users and then only
in certain directories.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN507"
></A
><B
>26. </B
>501 REST not compatible with server configuration</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>As mentioned in the description of the HiddenStor configuration directive,
use of that directive is incompatible with the FTP command REST. Either
disable use of REST with the AllowRetrieveRestart and AllowStoreRestart
directives, or do not use HiddenStor.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN512"
></A
><B
>27. </B
>The time being displayed is wrong</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The default behaviour for ProFTPD is to display all times relative
to GMT. To use local time set "TimesGMT off" in the server section of
the config. There is a known issue with Redhat 7, with regard to time
handling.
<A
HREF="http://www.redhat.com/support/rh7-errata-bugfixes.html"
TARGET="_top"
>http://www.redhat.com/support/errata/rh7-errata-bugfixes.html</A
></P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN518"
></A
><B
>28. </B
>Authentication is taking too long</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Make sure that ReverseDNS is disabled, turn off ident lookups.
Additionally check the size of your /etc/passwd (or shadow) file, if
it is large then the only solution may be to move to another
authentication scheme.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN523"
></A
><B
>29. </B
>Corrupted files</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There appear to be some problems with both the use of sendfile()
in ProFTPD and with the implementation within certain operating systems.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN528"
></A
><B
>30. </B
>Can I upgrade ProFTPD without terminating the current sessions?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Short answer, no. Longer answer is no, but you can minimise the
effects. The cleanest approach on servers which have significant
amounts of traffic appears to be to use ftpshut to block new
connections and terminate existing ones after a pre-determined time
period and then to upgrade and restart. This approach limits the
number of downloads which are terminated part way through.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN533"
></A
><B
>31. </B
>No such group "nogroup"</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The default ProFTPD configuration file uses the user "nouser" and
the group "nogroup", some systems / distributions do not have the
group "nogroup" defined. The solution is to either add the group
"nogroup" to /etc/groups or to change the "nogroup" entry in the
proftpd.conf to a group which does exist.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN538"
></A
><B
>32. </B
>Why do I see "unable to set groups: Invalid argument"? </P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The setting of the group privileges for a process uses the setgroups(2)
system call. This call will fail with the above error message for
one of two reasons: there is a negative GID value for one of the
groups, or the maximum number of groups for a single user has been
exceeded.</P
><P
>Ideally, all IDs, both UID and GID, will be positive. Unfortunately,
it is common on many systems to use -1 or -2, especially for such
users as 'nobody', or group 'nogroup'. Use of these values uses C's
treatment of data types to make the actual numeric value very high;
some functions, like setgroups(), do not like this, though. In
general, always use positive ID numbers.</P
><P
>The other limitation is the number of supplemental groups for a user
(eg non-primary groups, the ones configured in /etc/group). The
maximum number of supplemental groups to which a user may belong
is defined by the operating system constant NGROUPS_MAX. On
some operating systems, such as Solaris, this limitation may be
tunable.</P
><P
>Some other applications may not encounter this error if they use the
initgroups(3) function, which reads the /etc/group file for a user's
supplemental group memberships, and sets those groups. This function,
however, silently ignores any supplemental groups for user greater than
NGROUPS_MAX, unlike setgroups(2), which complains.</P
><P
> If this is the cause of your error message, any solution will most
likely involve reducing the number of groups your users are members of,
or tuning the NGROUPS_MAX value, if your operating system allows it.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN547"
></A
><B
>33. </B
>Why do I see error messages like these when I logout?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
> <PRE
CLASS="PROGRAMLISTING"
> PAM(exit): Permission denied
open_module: stat(/usr/lib/security/pam_unix.so.1) failed: No such file or directory
load_modules: can not open module /usr/lib/security/pam_unix.so.1
PAM(exit): Dlopen failure.
</PRE
></P
><P
>These messages appear when the DefaultRoot configuration directive is
in effect. This directive causes a user to be confined using the
chroot(2) system call. This call, however, affects other system
utilities, such as PAM. In this case, PAM's configuration is causing
the PAM library to attempt to open PAM modules using a path that is
no longer valid, thus the errors. This happens on logout because the
chroot has already happened by that point; on login, the PAM modules
are successfully found and loaded before the chroot, so no errors.
These are merely cosmetic reporting errors, and do not really affect
the functionality or security of the server.</P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="AEN553"
></A
>Chapter 5. Configuration problems</H1
><DIV
CLASS="QANDASET"
><DL
><DT
>1. <A
HREF="#AEN558"
>How do I add another anonymous login or guest account?</A
></DT
><DT
>2. <A
HREF="#AEN565"
>How do I ftp as root?</A
></DT
><DT
>3. <A
HREF="#AEN572"
>How do I provide a secure upload facility?</A
></DT
><DT
>4. <A
HREF="#AEN579"
>How can I stop my users from using their space as a warez repository</A
></DT
><DT
>5. <A
HREF="#AEN584"
>Can I rotate files out of an upload directory after upload?</A
></DT
><DT
>6. <A
HREF="#AEN589"
>How can I hide a directory from anonymous clients.</A
></DT
><DT
>7. <A
HREF="#AEN597"
>File/Directory hiding isn't working for me!</A
></DT
><DT
>8. <A
HREF="#AEN602"
>I want to prevent users from accessing a hidden directory</A
></DT
><DT
>9. <A
HREF="#AEN607"
>How do I setup a virtual FTP server?</A
></DT
><DT
>10. <A
HREF="#AEN614"
>I only want to allow anonymous access to a virtual server.</A
></DT
><DT
>11. <A
HREF="#AEN620"
>How does <Limit LOGIN> work, and where should I use it?</A
></DT
><DT
>12. <A
HREF="#AEN630"
>How can I limit users to a particular directory tree?</A
></DT
><DT
>13. <A
HREF="#AEN651"
>How do I create individual anonymous FTP sites for my users?</A
></DT
><DT
>14. <A
HREF="#AEN665"
>I want to support normal login and Anonymous under a particular
user</A
></DT
><DT
>15. <A
HREF="#AEN673"
>Why doesn't Anonymous ftp work (550 login incorrect)?</A
></DT
><DT
>16. <A
HREF="#AEN687"
>Bandwidth control</A
></DT
><DT
>17. <A
HREF="#AEN693"
>CHMOD isn't working</A
></DT
><DT
>18. <A
HREF="#AEN698"
>How can I limit the size of uploaded files?</A
></DT
><DT
>19. <A
HREF="#AEN703"
>Can I disable Anonymous logins?</A
></DT
><DT
>20. <A
HREF="#AEN708"
>Limiting the connections per loginID</A
></DT
><DT
>21. <A
HREF="#AEN713"
>How do I configure proftpd to allow transfer
resumption (for downloads and uploads)?</A
></DT
><DT
>22. <A
HREF="#AEN720"
>When should the Bind directive be used?</A
></DT
></DL
><P
>Problems encountered in trying to make the server behave
exactly as required after compilation and installation are
complete and the server is running.</P
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN558"
></A
><B
>1. </B
>How do I add another anonymous login or guest account?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>You should look in the sample-configurations/ directory from
your distribution tarball. Basically, you'll need to create another
user on your system for the guest/anonymous ftp login. For security
reasons, it's very important that you make sure the user account
either has a password or has an "unmatchable" password. The root
directory of the guest/anonymous account doesn't have to be the user's
directory, but it makes sense to do so. After you have created the
account, put something like the following in your /etc/proftpd.conf
file (assuming the new user/group name is private/private):</P
><PRE
CLASS="PROGRAMLISTING"
><Anonymous ~private>
AnonRequirePassword off
User private
Group private
RequireValidShell off
<Directory *>
<Limit WRITE>
DenyAll
</Limit>
</Directory>
</Anonymous>
</PRE
><P
>This will allow ftp clients to login to your site with the username
"private" and their e-mail address as a password. You can change the
AnonRequirePassword directive to "on" if you want clients to be
forced to transmit the correct password for the "private" account.
This sample configuration allows clients to change into, list and read
all directories, but denies write access of any kind.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN565"
></A
><B
>2. </B
>How do I ftp as root?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>First off this is a <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>bad</I
></SPAN
> idea ftping as root is insecure,
there are better more secure ways of shifting files as root.</P
><P
>To enable root ftp ensure that the directive "RootLogin on" is
included in your configuration.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN572"
></A
><B
>3. </B
>How do I provide a secure upload facility?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The following snippet from a sample configuration file
illustrates how to protect an "upload" directory in such a fashion
(which is a very good idea if you don't want people using your site
for "warez"):</P
><PRE
CLASS="PROGRAMLISTING"
><Anonymous /home/ftp>
# All files uploaded are set to username.usergroup ownership
User username
Group usergroup
UserAlias ftp username
AuthAliasOnly on
RequireValidShell off
<Directory pub/incoming/>
<Limit STOR CWD>
AllowAll
</Limit>
<Limit READ RMD DELE MKD>
DenyAll
</Limit>
</Directory>
</Anonymous>
</PRE
><P
>This denies all write operations to the anonymous root directory
and sub-directories, except "incoming/" where the permissions are
reversed and the client can store but not read. If you used <Limit
WRITE> instead of <Limit STOR> on <Directory incoming>,
ftp clients would be allowed to perform all write operations to the
sub-dir, including deleting, renaming and creating directories.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN579"
></A
><B
>4. </B
>How can I stop my users from using their space as a warez repository</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The above fragment will control anonymous users however if a local
user with a full account with up and download capability is abusing
their space then the technical measures which can be taken are
limited. Applying a sane system quota is a good start, using the
mod_quota and mod_ratio modules may control the rates of
upload/download making it less useful as a warez repository. In the
end it comes down to system monitoring and good site AUP's and
enforcement.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN584"
></A
><B
>5. </B
>Can I rotate files out of an upload directory after upload?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Yes. You'll need to write a script which either checks the
contents of the directory regularly and moves once it's detected no
size change in a file for xyz seconds. Or a script which monitors an
upload log. There is no automatic method for doing this.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN589"
></A
><B
>6. </B
>How can I hide a directory from anonymous clients.</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Use the HideUser or HideGroup directive in combination with the
proper user/group ownership on the directive. For example, if you
have the follow directory in your anonymous ftp directory tree:</P
><PRE
CLASS="PROGRAMLISTING"
>drwxrwxr-x 3 ftp staff 6144 Apr 21 16:40 private
</PRE
><P
>You can use a directive such as "HideGroup staff" to hide the private
directory from a directory listing. For example:</P
><PRE
CLASS="PROGRAMLISTING"
><Anonymous ~ftp>
...
<Directory Private>
HideGroup staff
</Directory>
...
</Anonymous>
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN597"
></A
><B
>7. </B
>File/Directory hiding isn't working for me!</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>You need to make sure that the group you are hiding isn't the
anonymous ftp user's primary group, or HideGroup won't apply.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN602"
></A
><B
>8. </B
>I want to prevent users from accessing a hidden directory</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>You can either change the permissions on the directory to prevent
the anonymous FTP user from accessing it, or if you want to make it
appear completely invisible (as though there is no such directory),
use the IgnoreHidden directive inside a <Limit> block for one or
more commands that you want to completely ignore the hidden directory
entries (ignore = act as if the directory entry does not exist).</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN607"
></A
><B
>9. </B
>How do I setup a virtual FTP server?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>You'll need to configure your host to be able to handle multiple IP
addresses. This is often called "aliasing", and can generally be
configured through an IP alias or dummy interface. You need to read
your operating system documentation to figure out how to do this. Once
your have the host configured to accept the additional IP address that
you wish to offer a virtual FTP server on, use the <VirtualHost>
configuration directive to create the virtual server:</P
><PRE
CLASS="PROGRAMLISTING"
><VirtualHost 10.0.0.1>
ServerName "My virtual FTP server"
</VirtualHost>
</PRE
><P
>You can add additional directive blocks into the <VirtualHost> block
in order to create anonymous/guest logins and the like which are only
available on the virtual host.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN614"
></A
><B
>10. </B
>I only want to allow anonymous access to a virtual server.</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Use a <Limit LOGIN> block to deny access at the top-level of
the virtual host, then use <Limit LOGIN> again in your
<Anonymous> block to allow access to the anonymous login. This
permits logins to a virtual anonymous server, but denies to everything
else. Example:</P
><PRE
CLASS="PROGRAMLISTING"
><VirtualHost 10.0.0.1>
ServerName "My virtual FTP server"
<Limit LOGIN>
DenyAll
</Limit>
<Anonymous /usr/local/private>
User private
Group private
<Limit LOGIN>
AllowAll
</Limit>
...
</Anonymous>
</VirtualHost>
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN620"
></A
><B
>11. </B
>How does <Limit LOGIN> work, and where should I use it?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The <LOGIN> directive is used to control connection or login
access to a particular context (the directive block which contains
it). When a client initially connects to ProFTPD, the daemon searches
the configuration tree for <Limit LOGIN> directives, and
attached parameters (such as Allow, Deny, etc). If it determines that
there is no possible way for the client to ever be allowed to login,
such as a "Deny from" matching the client's source address, without an
overriding "Allow from" at a lower level, the client is disconnected
without being offered the opportunity to transmit a user and password.</P
><P
>However, if it is possible for the client to be allowed a login,
ProFTPD continues as per normal, allowing the client to login only if
the proper <Limit LOGIN> applies. Normally, <Limit> directive blocks
are allowed in the server config, <VirtualHost>, <Anonymous>
and <Directory> contexts. However, <Limit LOGIN> should not be
used in a <Directory> context, as clients do not connect/login to a
directory (and thus it is meaningless).</P
><P
>By way of example, the following configuration snippet illustrates a
<Limit LOGIN> deny which will cause any incoming connections from the
10.1.1.x subnet to be immediately disconnected, without a welcome
message:</P
><PRE
CLASS="PROGRAMLISTING"
>...
<Limit LOGIN>
Order deny,allow
Deny from 10.1.1.
Allow from all
</Limit>
...
</PRE
><P
>Next, an example of a configuration using <Limit LOGIN> that will not
immediately disconnect an incoming client, but will return "Login
invalid" for all login attempts except anonymous.</P
><PRE
CLASS="PROGRAMLISTING"
>...
<Limit LOGIN>
DenyAll
</Limit>
<Anonymous ~ftp>
...
<Limit LOGIN>
AllowAll
</Limit>
...
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN630"
></A
><B
>12. </B
>How can I limit users to a particular directory tree?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>For general open access you can use an <Anonymous> directive context block,
possibly in combination with a UserPassword/AnonRequirePassword directive. </P
><P
>However if you wish to jail an entire group (or groups) of users,
you can use the DefaultRoot directive. DefaultRoot lets you specify a
root jailed directory (or "~" for the user's home directory), and an
optional group-expression argument which can be used to control which
groups of users the jail will be applied to. For example:</P
><PRE
CLASS="PROGRAMLISTING"
>...
<VirtualHost myhost.mynet.foo>
DefaultRoot ~
...
</VirtualHost>
</PRE
><P
>This creates a configuration where all users who log into
myhost.mynet.foo are jailed into their home directories (cannot chdir
into a higher level directory). Alternatively, you could:</P
><PRE
CLASS="PROGRAMLISTING"
>...
<VirtualHost myhost.mynet.foo>
DefaultRoot /u2/public users,!staff
...
</VirtualHost>
</PRE
><P
>In this example, all users who are members of group "users", but
not members of group "staff" are jailed into /u2/public. If a user
does not meet the group-expression requirements, they login as per
normal (not jailed, default directory is their home). You can use
multiple DefaultRoot directives to create multiple jails inside the
same directive context. If two DefaultRoot directives apply to the
same user, ProFTPD arbitrarily chooses one (based on how the
configuration file was parsed).</P
><A
NAME="AEN639"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN640"
></A
>Security Implications</H3
><P
>The DefaultRoot directive is implemented using the chroot(2) system
call. This moves the "/" (or root) directory to a specified point
within the file system and jails the user into this sub-tree. However
this is not the holy grail of security, a chroot jail can be broken,
it is not a trivial matter but it's nowhere near impossible.
DefaultRoot should be used as part of a general system of security not
the only security measure.</P
><P
>A more detailed <A
HREF="http://www.bpfh.net/simes/computing/chroot-break.html"
TARGET="_top"
>http://www.bpfh.net/simes/computing/chroot-break.html</A
> on this subject and on the breaking of chroot jails has been written by Simon Burr</P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN644"
></A
>Non-root server issues</H3
><P
>The chroot() system call will not work under a non-root ftp server
process, the call requires root privaliges. Without them it simply
doesn't work, there doesn't appear to be any checking in the code of
the uid/gid before calling chroot so using DefaultRoot in such a setup
will cause the server to fail.</P
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN646"
></A
>Symlinks</H3
><P
>Symlinks will not work from within a chrooted area. The reason
should be clear from a casual inspection of the nature of
the chroot command. It is not possible to have a symbolic
link to a directory which can"t be reached beacuse it's
outside of the current chroot. Work arounds to allow
access to other parts of the file system include exporting
the part of the filesystem to be accessed from inside the
chroot and mounting via NFS, using hard file links or (on
Solaris) using lofs to mount the directory via the loopback.
</P
><PRE
CLASS="PROGRAMLISTING"
>mount -Flofs /home/data1 /ftp/data1
mount -Flofs /home/data2 /ftp/data2
</PRE
><P
>As of the 2.4.x Linux kernel tree it is possible to mount filesystems
multiple times and to mount subdirectories of filesystems elsewhere on
the filesystem.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN651"
></A
><B
>13. </B
>How do I create individual anonymous FTP sites for my users?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There are two methods of accomplishing this (possibly more).
First, you can create a directory structure inside your anonymous FTP
root directory, creating a single directory for each user and setting
ownership/permissions as appropriate. Then, either create a symlink
from each user's home directory into the FTP site, or instruct your
users on how to access their directory.</P
><P
>The alternate method (and more versatile) of accomplishing per-user
anonymous FTP is to use AnonymousGroup in combination with the
DefaultRoot directory. You'll probably want to do this inside a
<VirtualHost>, otherwise none of your users will be able to access
your system without being stuck inside their per-user FTP site.
Additionally, you'll want to use a deferred <Directory> block to
carefully limit outside access to each user's site.</P
><P
></P
><OL
TYPE="1"
><LI
><P
>Create a new unix group on your system named `anonftp". Please
each user who will have per-user anonymous FTP in this group.</P
></LI
><LI
><P
>Create an `anon-ftp" and `anon-ftp/incoming" directory in each
user's home directory.</P
></LI
><LI
><P
>Modify your /etc/proftpd.conf file to look something like this
(you'll probably want to customize this to your needs):</P
><PRE
CLASS="PROGRAMLISTING"
> <VirtualHost my.per-user.virtual.host.address>
# the next line limits all logins to this virtual host, so that only
anonftp users can connect
<Limit LOGIN>
DenyGroup !anonftp
</Limit>
# limit access to each user's anon-ftp directory, we want read-only
except on incoming
<Directory ~/anon-ftp>
<Limit WRITE>
DenyAll
</Limit>
</Directory>
# permit stor access to each user's anon-ftp/incoming directory,
but deny everything else
<Directory ~/anon-ftp/incoming>
<Limit STOR>
AllowAll
</Limit>
<Limit READ WRITE>
DenyAll
</Limit>
</Directory>
# provide a default root for all logins to this virtual host.
DefaultRoot ~/anon-ftp
# Finally, force all logins to be anonymous for the anonftp group
AnonymousGroup anonftp
</VirtualHost>
</PRE
></LI
></OL
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN665"
></A
><B
>14. </B
>I want to support normal login and Anonymous under a particular
user</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>You can use the AuthAliasOnly directive to control how and
where real usernames get authenticated (as opposed to aliased names,
via the UserAlias directive). Note that it is still impossible to
have two identical aliased names login to different anonymous sites;
for that you would need <VirtualHost>.</P
><P
>Example:</P
><PRE
CLASS="PROGRAMLISTING"
>...
<Anonymous ~jrluser>
User jrluser
Group jrluser
UserAlias ftp jrluser
UserAlias anonymous jrluser
AuthAliasOnly on
...
</Anonymous>
</PRE
><P
>Here, the <Anonymous> configuration for ~jrluser is set to allow
alias authentication only. Thus, if a client attempts to authenticate
as "jrluser", the anonymous config will be ignored and the client will
be authenticated as if they were a normal user (typically resulting in
`jrluser" logging in normally). However, if the client uses the
aliased username `ftp" or `anonymous", the anonymous block is applied.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN673"
></A
><B
>15. </B
>Why doesn't Anonymous ftp work (550 login incorrect)?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Things to check</P
><P
></P
><P
><B
>Check the following first:</B
></P
><UL
><LI
><P
>Make sure the user/group you specified inside the <Anonymous>
block actually exists. This must be a real user and group, as it is
used to control whom the daemon runs as and authenticates as.</P
></LI
><LI
><P
>If RequireValidShell is not specifically turned off, make sure
that your "ftp user" (as specified by the User directive inside an
<Anonymous> block), has a valid shell listed in /etc/shells. If you do
not wish to give the user a valid shell, you can always use
"RequireValidShell off" to disable this check.</P
></LI
><LI
><P
>If UseFtpUsers is not specifically turned off, make sure that
your "ftp user" is not listed in /etc/ftpusers.</P
></LI
></UL
><P
>If all else fails, you should check your syslog. When authentication
fails for any reason, ProFTPD uses the syslog mechanism to log the
reason for failure; using the AUTH (or AUTHPRIV) facility. If you need
further assistance, you can send email, including related syslog
entries and your configuration file, to the ProFTPD mailing list
mentioned elsewhere in this FAQ.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN687"
></A
><B
>16. </B
>Bandwidth control</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>A new patch providing the TransferRate directive has
been provided and is slated for inclusion in 1.2.8, this
gives per-connection bandwidth limits with Class support.
The limits are more effective against downloads than
uploads.</P
><P
>There is no method to control the total bandwidth a
single VirtualHost context can use.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN693"
></A
><B
>17. </B
>CHMOD isn't working</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>AllowChmod is deprecated and has been replaced with
the SITE_CHMOD expansion for controlling this
functionality.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN698"
></A
><B
>18. </B
>How can I limit the size of uploaded files?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>As of 1.2.7rc1 there are two new directives
MaxRetrieveFileSize and MaxStoreFileSize to control the
maximum size of files being transfered to or from the
server.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN703"
></A
><B
>19. </B
>Can I disable Anonymous logins?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Yes, just remove all the <Anonymous> sections
from your configuration file and reload the daemon.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN708"
></A
><B
>20. </B
>Limiting the connections per loginID</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>As of 1.2.7rc1 MaxClientsPerUser has been
implemented.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN713"
></A
><B
>21. </B
>How do I configure proftpd to allow transfer
resumption (for downloads and uploads)?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>To allow downloads to be resumed, you need to use the
AllowRetrieveRestart configuration directive.</P
><P
>To allow uploads to be resumed, you need to use both the
AllowOverwrite and AllowStoreRestart directives. The reason that both
need to be allowed is that a restarted/resumed upload is a form of
overwriting the file.</P
><P
>Also note that using HiddenStor and AllowStoreRestart is incompatible,
as mentioned in the documentation for the AllowStoreRestart
and HiddenStor directives.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN720"
></A
><B
>22. </B
>When should the Bind directive be used?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The Bind directive is used to specify additional interfaces (addresses)
for a given server; it is *not* used to configure the main interface
for the server. For <VirtualHost> servers, this is not a problem, as
the main interface for the server is set in the <VirtualHost> line.</P
><P
>For the main "default" server, however, the controlling of the main
interface is more problematic. There is currently a bug report
opened for this issue:</P
><P
><A
HREF="http://bugs.proftpd.org/show_bug.cgi?id=1253"
TARGET="_top"
>http://bugs.proftpd.org/show_bug.cgi?id=1253</A
></P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="AEN727"
></A
>Chapter 6. Security</H1
><DIV
CLASS="QANDASET"
><DL
><DT
>1. <A
HREF="#AEN731"
>General</A
></DT
><DT
>2. <A
HREF="#AEN741"
>Surely running ProFTPD as non-root will help?</A
></DT
><DT
>3. <A
HREF="#AEN748"
>How can I control what commands the server accepts?</A
></DT
><DT
>4. <A
HREF="#AEN753"
>How can I prevent the server version from being displayed?</A
></DT
><DT
>5. <A
HREF="#AEN759"
>I want to show a message prior to login</A
></DT
><DT
>6. <A
HREF="#AEN765"
>I want to display a message after login</A
></DT
><DT
>7. <A
HREF="#AEN771"
>Can I have a custom welcome response?</A
></DT
><DT
>8. <A
HREF="#AEN778"
>External Programs</A
></DT
><DT
>9. <A
HREF="#AEN783"
>Why do I see "No certificates found!"? </A
></DT
><DT
>10. <A
HREF="#AEN791"
>I can delete files owned by root. Why is this?</A
></DT
></DL
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN731"
></A
><B
>1. </B
>General</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>As with all software there have been a number of security issues
during the life of the project. The most recent information can
always be found on http://www.proftpd.org/security.html</P
><P
>Versions 1.2.0 and above should be considered to be production code
and few if any new features will be added to this code branch to
maintain stability.</P
><A
NAME="AEN736"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN737"
></A
>What about using Stackguard?</H3
><P
>Stackguard (<A
HREF="http://immunix.org"
TARGET="_top"
>http://immunix.org</A
>) is a gcc variant which can protect programs from stack-smashing attacks, programs compiled using Stackguard dies without executing the stack code. While this approach is a good first line of defense against future problems it"s not a complete cure-all. Some of the buffer overflows were found on static variables, which are not protected by stack protection mechanisms. </P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN741"
></A
><B
>2. </B
>Surely running ProFTPD as non-root will help?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Running ProFTPD as a non-root user gives only a marginal security
improvement on the normal case and adds some functional problems.
Such as not being able to bind to ports 20 or 21, unless it's spawned
from inetd.</P
><P
>ProFTPD takes a middle road in terms of security. It only uses
root privileges where required and drops to the UID defined in the
config file at all other times. Times when root is required include,
binding to ports < 1024, setting resource limits, reading
configuration information and some network code.</P
><P
>For Linux 2.2.x kernel systems there is the POSIX style
mod_linuxprivs module which allows very fine grain control over
privileges. This is highly recommended for security-conscious admins.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN748"
></A
><B
>3. </B
>How can I control what commands the server accepts?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Use a sane Allow/DenyFilter, these directives use regular
expressions to control all text sent over the control socket. (If
anyone has some good examples please let me know.) </P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN753"
></A
><B
>4. </B
>How can I prevent the server version from being displayed?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Setting SeverIdent to "off" should turn off the information about
what type of server is running. To have maximum effect this directive
should either be in the Global context or included in every virtual
host block and the default block.</P
><PRE
CLASS="PROGRAMLISTING"
>ServerIdent On "Linux.co.uk server"
ServerIdent Off
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN759"
></A
><B
>5. </B
>I want to show a message prior to login</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Use the DisplayConnect directive to specify a file containing a
message to be displayed prior to login.</P
><PRE
CLASS="PROGRAMLISTING"
>DisplayConnect /ftp/ftp.virtualhost/login.msg
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN765"
></A
><B
>6. </B
>I want to display a message after login</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Use the DisplayLogin directive, this sends a specified ASCII file to the
connected user.</P
><PRE
CLASS="PROGRAMLISTING"
>DisplayLogin /etc/proftp.msg
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN771"
></A
><B
>7. </B
>Can I have a custom welcome response?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Use the AccessGrantMsg directive, this sends a simple single line
message back to the user after a successful authentication. Magic
cookies appear to be honoured in this directive.</P
><PRE
CLASS="PROGRAMLISTING"
>AccessGrantMsg "Guest access granted for %u."
</PRE
><P
>Note, this directive has an overriding default and needs to be
specified in both VirtualHost and Anonymous blocks.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN778"
></A
><B
>8. </B
>External Programs</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>ProFTPD has been designed to run as a secure ftp server, this means
that it tries to keep as much as possible under it's control. An
external program is a security risk in itself because it's behaviour
is not controllable from within the ftpd code.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN783"
></A
><B
>9. </B
>Why do I see "No certificates found!"? </P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>This message is generated by mod_tls, the third-party module that can
be used to encrypt both the control and data connections with TLS
(Transport Layer Security), the next generation of SSL. Certificates
are used to establish the security context for this secure transport.</P
><P
>Generation of certifications is beyond the scope of this document;
however, more information can be found here:</P
><P
> <A
HREF="http://en.tldp.org/HOWTO/SSL-Certificates-HOWTO/"
TARGET="_top"
>http://en.tldp.org/HOWTO/SSL-Certificates-HOWTO/</A
></P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN791"
></A
><B
>10. </B
>I can delete files owned by root. Why is this?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>ProPTPD follows the UNIX file permission rules when determining the level of access and/or control a user is granted when working with a file. UNIX systems divide the world into three classes when determining the permissions that a user is granted for a particular file:
<P
></P
><UL
><LI
><P
>User - the owner of the file</P
></LI
><LI
><P
>Group - a collection of users defined in /etc/group</P
></LI
><LI
><P
>Others - neither the owner, nor a member of the group</P
></LI
></UL
></P
><P
>Every file in a Unix filesystem has a permission definition associated with it. At a minimum, the permission established for a file will determine whether a particular user may READ, WRITE, or EXECUTE the file in question. A directory listing will show the permissions associated with a file in the format shown below:
<PRE
CLASS="PROGRAMLISTING"
> rwx r-x r-x
| | |
| | |_____________ Others: READ/NO WRITE/EXECUTE
| |__________________ Group: READ/NO WRITE/EXECUTE
|_______________________ User: READ/WRITE/EXECUTE </PRE
></P
><P
>In the sample directory listing shown below, READ/WRITE/EXECUTE privileges are granted to the owner of the directory, and READ/EXECUTE privileges are granted to members of the <TT
CLASS="COMPUTEROUTPUT"
>users</TT
> group and everyone else. Note the letter "d" at the beginning of each entry, denoting that the entry is actually a directory.
<PRE
CLASS="PROGRAMLISTING"
> prince> ls -l /home/ftp
total 8
drwxr-xr-x 2 andrea users 4096 May 3 00:40 andrea
drwxr-xr-x 2 eve users 4096 May 3 00:40 eve
prince> ls -l /home/ftp/andrea
total 156
-rw-r--r-- 1 andrea users 85991 May 3 01:12 bland.txt
-rwxr-xr-x 1 root root 65107 May 3 01:12 secret.txt </PRE
></P
><P
>The answer to this question is shown in the above example. When describing the permissions associated with a directory, WRITE means that permission is granted to modify the contents of a directory by adding or deleting files. Thus, the user <TT
CLASS="COMPUTEROUTPUT"
>andrea</TT
> may delete the file <TT
CLASS="COMPUTEROUTPUT"
>secret.txt</TT
>, even though she cannot modify the file itself.</P
><P
>Refer to the documentation for the <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>IgnoreHidden</I
></SPAN
> and <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>HideNoAccess</I
></SPAN
> directives for a method to mitigate this hazard.</P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="AEN813"
></A
>Chapter 7. User Authentication</H1
><DIV
CLASS="QANDASET"
><DL
><DT
>1. <A
HREF="#AEN818"
>Why is PAM the default authentication system?</A
></DT
><DT
>2. <A
HREF="#AEN823"
>Authentication methods supported</A
></DT
><DT
>3. <A
HREF="#AEN841"
>Problems with non-PAM authentication</A
></DT
><DT
>4. <A
HREF="#AEN847"
>AuthPAMAuthorative is an unknown directive!</A
></DT
><DT
>5. <A
HREF="#AEN852"
>Configuring PAM</A
></DT
><DT
>6. <A
HREF="#AEN867"
>pam_sm_open_session errors</A
></DT
><DT
>7. <A
HREF="#AEN872"
>Normal users can't login, only anon.</A
></DT
><DT
>8. <A
HREF="#AEN877"
>AuthPAMAuthoritative</A
></DT
><DT
>9. <A
HREF="#AEN885"
>LDAP</A
></DT
><DT
>10. <A
HREF="#AEN891"
>Encrypted passwords</A
></DT
><DT
>11. <A
HREF="#AEN896"
>SecureID</A
></DT
><DT
>12. <A
HREF="#AEN901"
>One time passwords</A
></DT
><DT
>13. <A
HREF="#AEN910"
>RADIUS</A
></DT
><DT
>14. <A
HREF="#AEN915"
>Anonymous password checking</A
></DT
><DT
>15. <A
HREF="#AEN920"
>Why do I see "PAM(name): Authentication failure", but I can login
anyway?</A
></DT
></DL
><P
>This section is being re-written due to major structural changes to the SQL module prior to 1.2.0</P
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN818"
></A
><B
>1. </B
>Why is PAM the default authentication system?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Security, pure and simple. PAM is the most secure (or securable)
of the available authentication systems. Many of the issues and
configuration hints for PAM are contained in README.PAM which is
bundled with the server source and in the various packaged builds. To
use /etc/passwd manual compilation will be required with the configure
script being run with the --without-pam flag. Unless the PAM
subsystem is properly configured authentication will fail.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN823"
></A
><B
>2. </B
>Authentication methods supported</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
><LI
><P
>PAM</P
></LI
><LI
><P
>Standard /etc/passwd lookups</P
></LI
><LI
><P
>NIS</P
></LI
><LI
><P
>Shadow passwords</P
></LI
><LI
><P
>Indvidual passwd/group files for each virtual</P
></LI
><LI
><P
>SQL databases</P
></LI
></P
><P
>If these don't fit in with your system then writing a custom module
or using such as the "ld.so.preload" approach to intercept
getpwbynam() system calls works happily with ProFTPD.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN841"
></A
><B
>3. </B
>Problems with non-PAM authentication</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Generally these problems will be cured by either disabling PAM
completely or by ensuring that these directives are set</P
><PRE
CLASS="PROGRAMLISTING"
>PersistentPasswd off
AuthPAMAuthoritative off
</PRE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN847"
></A
><B
>4. </B
>AuthPAMAuthorative is an unknown directive!</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Check the spelling it should be AuthPAMAuthoritative not
AuthPAMAuthorative or any other variation.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN852"
></A
><B
>5. </B
>Configuring PAM</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There is a README.Pam in the top directory of the ProFTPD install
directory :</P
><A
NAME="AEN856"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN857"
></A
>Redhat Linux</H3
><PRE
CLASS="PROGRAMLISTING"
>#%PAM-1.0
auth required /lib/security/pam_listfile.so item=user
sense=deny file=/etc/ftpusers onerr=succeed
auth required /lib/security/pam_pwdb.so shadow nullok
account required /lib/security/pam_pwdb.so
session required /lib/security/pam_pwdb.so
</PRE
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN859"
></A
>SuSE Linux</H3
><P
>SuSE appears to uses pam_unix rather than pam_pwdb which is the
Redhat approach. All references to pam_pwdb should be replaced with
"pam_unix" on SuSE systems.</P
><P
>The following fragment is reported to work fine on SuSE 6.2</P
><PRE
CLASS="PROGRAMLISTING"
>/etc/pam.d/ftpd
#%PAM-1.0
# Uncomment this to achieve what used to be ftpd -A.
# auth required /lib/security/pam_listfile.so item=user sense=allow file=/etc/ftpchroot onerr=fail
auth required /lib/security/pam_listfile.so item=user
sense=deny file=/etc/ftpusers onerr=succeed
auth sufficient /lib/security/pam_ftp.so
auth required /lib/security/pam_unix.so
auth required /lib/security/pam_shells.so
account required /lib/security/pam_unix.so
password required /lib/security/pam_unix.so
session required /lib/security/pam_unix.so
</PRE
><H3
CLASS="BRIDGEHEAD"
><A
NAME="AEN863"
></A
>FreeBSD</H3
><P
>FreeBSD does not support PAM session directives. If you remove the
following line from the FreeBSD section of README.PAM, PAM should work
properly under recent versions of FreeBSD.</P
><PRE
CLASS="PROGRAMLISTING"
> ftp session required pam_unix.so try_first_pass
</PRE
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN867"
></A
><B
>6. </B
>pam_sm_open_session errors</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>ProFTPD requires PAM version 0.59 or better. pam_sm_open_session
is not part of previous versions.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN872"
></A
><B
>7. </B
>Normal users can't login, only anon.</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Check that the /etc/pam.d/ftp file exists on the system and is
configured as detailed in README.PAM</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN877"
></A
><B
>8. </B
>AuthPAMAuthoritative</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Currently AuthPAMAuthoritative defaults on "ON" resulting in login
failures if PAM cannot authenticate the user. This breaks the
AuthUserFile directive as it never gets a chance to authenticate the
user unless the AuthPAMAuthoritative directive is set to "OFF"</P
><P
>The reasoning behind the current default is to ensure that the
system is secure by default requiring that the admin explicitly and
knowingly has to disable it. There are discussions underway which
may result in the directive flipping to a default of "Off" if
AuthUserFile is specified.</P
><P
><SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Note:</I
></SPAN
> as of the current CVS and the forthcoming pre9
release the default has changed to "Off"</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN885"
></A
><B
>9. </B
>LDAP</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>mod_ldap is currently stable; there were a couple bugs that were
squashed after release 1.0 of the module. it is still udner
development , check the <A
HREF="http://horde.net/~jwm/software/mod_ldap/"
TARGET="_top"
>http://horde.net/~jwm/software/mod_ldap/</A
> for
more information. There is an example config fragment on the author's
site which gives a reasonable idea on how to use this module.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN891"
></A
><B
>10. </B
>Encrypted passwords</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>There are patches which are being merged in at the moment to provide
SHA encryption. The plan is to have the server get all user information
except passwords via an anonymous bind. The server will then reconnect
as a user is logging in and attempt to get the password via an encrypted
connection. This should be in the next major release (2.5)</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN896"
></A
><B
>11. </B
>SecureID</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>No support yet</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN901"
></A
><B
>12. </B
>One time passwords</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>This is possible using either PAM or the Opie modules. The module
passes back a challenge which the user puts into a key generator along
with their "pass phrase" and it gives them back 5 words which get sent
as the password. As long as you do it correctly it will never repeat.</P
><P
>It requires <A
HREF="http://inner.net/opie/"
TARGET="_top"
>http://inner.net/opie/</A
> to be installed on the server. There are key gen clients for win95/98, *nix, mac.</P
><P
><A
HREF="ftp://ftp.urbanrage.com/pub/c/mod_opie.c"
TARGET="_top"
>ftp://ftp.urbanrage.com/pub/c/mod_opie.c</A
></P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN910"
></A
><B
>13. </B
>RADIUS</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The new mod_radius module provides RADIUS authentication
and accounting support to ProFTPD. </P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN915"
></A
><B
>14. </B
>Anonymous password checking</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Is it possible to check an offered email address in an anonymous
login before allowing access. Simple answer, not a hope in hell,
anonymous access is pretty much designed to be freely open without
checks and restrictions other than those placed on upload/download
from the site. The best that can be hoped for is decent logging and
tracking of accesses, and the requesting IP.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN920"
></A
><B
>15. </B
>Why do I see "PAM(name): Authentication failure", but I can login
anyway?</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>If the operating system supports PAM (Pluggable Authentication Modules)
proftpd will perform PAM authentication by default. However, this
authentication is not "authoritative" by default, meaning that
a PAM authentication failure will not necessary cause a login to
fail. The use of PAM can be configured using the AuthPAM configuration
directive; the "authoritativeness" of any PAM checks is controlled via
the AuthPAMAuthoritative configuration directive.</P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="AEN924"
></A
>Chapter 8. FAQ Notes</H1
><DIV
CLASS="QANDASET"
><DL
><DT
>1. <A
HREF="#AEN928"
>History</A
></DT
><DT
>2. <A
HREF="#AEN934"
>Acknowledgements and Thanks</A
></DT
></DL
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN928"
></A
><B
>1. </B
>History</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>The original text for this document was based on the
configuration FAQ on www.proftpd.org. It was taken over in
Sept 1999 when the maintainer of the software changed.</P
><P
>The faq is maintained by a group of people (usually
lurking on irc or on proftpd-docs) using CVS and Docbook.</P
></DIV
></DIV
><DIV
CLASS="QANDAENTRY"
><DIV
CLASS="QUESTION"
><P
><A
NAME="AEN934"
></A
><B
>2. </B
>Acknowledgements and Thanks</P
></DIV
><DIV
CLASS="ANSWER"
><P
><B
> </B
>Thanks to the developers, anyone who's posted useful information to
the mailing lists and those who've mailed me direct.</P
><P
>This document couldn't have been maintained without the Sgml Tools
package and the document layout defined by the Linux HOWTO
maintainers. </P
><P
>Some specific mentions, in no particular order, and I've missed
anyone please drop me a line.</P
><P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
>Updates to the SQL section, Michael Grabenstein
<mgrabens@popd.isinet.com></TD
></TR
><TR
><TD
>Matt Mozur, who's been cleaning up some of my mess
and generally stuffing patches in my direction.</TD
></TR
><TR
><TD
>TJ Saunders, for the HOWTOs and other docs.</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
></DIV
></DIV
></DIV
></BODY
></HTML
>
|