събота, февруари 23, 2013

FTP access-2

Като алтернативно решение на това
Изискванията са същите :
1.Admin has full access in the relevant section(s) - means read/write/rename/move/delete/overwrite
2.Guest access means read only
3.User access means read/write only (write means NOT overwrite)


И без това предният път с pure-ftpd явно нещо грешно съм описал та не можех да го възпроизведа отново затова новият solution е на базата на proftpd (10х бат Ицо)
Ограниченията ca user <-> command
Основният списък с командите : RawFTP 
Пълен такъв: RFC 959  - баси протокол на 28 години (от 1985-та) и user-ите още си го искат/търсят

  1. mkdir /home/ftp
  2. chmod -R 777 /home/ftp
  3. useradd ftp_admin ;  passwd ftp_admin ; useradd upload ; passwd upload ; useradd guest ; passwd guest
  4. apt-get install proftpd-basic
  5. cat /etc/proftpd/proftpd.conf
    ModulePath /usr/lib/proftpd
    LoadModule mod_ctrls_admin.c
    #LoadModule mod_tls.c
    LoadModule mod_radius.c
    LoadModule mod_quotatab.c
    LoadModule mod_quotatab_file.c
    LoadModule mod_quotatab_radius.c
    LoadModule mod_wrap.c
    LoadModule mod_rewrite.c
    LoadModule mod_load.c
    LoadModule mod_ban.c
    LoadModule mod_wrap2.c
    LoadModule mod_wrap2_file.c
    LoadModule mod_dynmasq.c
    LoadModule mod_exec.c
    LoadModule mod_shaper.c
    LoadModule mod_ratio.c
    LoadModule mod_site_misc.c
    LoadModule mod_facl.c
    LoadModule mod_unique_id.c
    ServerType standalone
    DefaultServer on
    Umask 022
    ServerName "0.0.0.0"
    ServerIdent on "DMT FTP Server"
    ServerAdmin sysadmin@playbox.tv
    IdentLookups off
    UseReverseDNS off
    Port 21
    PassivePorts 49152 65534
    #MasqueradeAddress None
    TimesGMT off
    MaxInstances 30
    MaxLoginAttempts 3
    TimeoutLogin 300
    TimeoutNoTransfer 120
    TimeoutIdle 120
    DisplayLogin welcome.msg
    DisplayChdir .message
    User nobody
    Group nogroup
    DirFakeUser off nobody
    DirFakeGroup off nogroup

    DefaultTransferMode binary
    AllowForeignAddress off
    AllowRetrieveRestart on
    AllowStoreRestart on
    DeleteAbortedStores off
    #TransferRate RETR 220
    #TransferRate STOR 250
    #TransferRate STOU 250
    #TransferRate APPE 250

    SystemLog /var/log/proftpd/system.log
    # Log file/dir access
    ExtendedLog /var/log/proftpd/access_log WRITE,READ
    # Record all logins
    ExtendedLog /var/log/proftpd/auth_log AUTH
    # Paranoia logging level....
    ExtendedLog /var/log/proftpd/paranoid_log ALL

    RequireValidShell off

    Ratios off
    SaveRatios off
    RatioFile "/restricted/proftpd_ratios"
    RatioTempFile "/restricted/proftpd_ratios_temp"
    CwdRatioMsg "Please upload first!"
    FileRatioErrMsg "FileRatio limit exceeded, upload something first..."
    ByteRatioErrMsg "ByteRatio limit exceeded, upload something first..."
    LeechRatioMsg "Your ratio is unlimited."


      AllowUser guest
      AllowUser uploader
      AllowUser ftp_admin
      DenyALL



    User guest
    Group guest
    AnonRequirePassword on
    MaxClients 20 "The server is full, hosting %m users"
    DisplayLogin welcome.msg
    DisplayChdir .msg

    Allow from All
    Deny from all

    AllowOverwrite off

     AllowAll


     DenyAll



    User uploader
    Group uploader
    AnonRequirePassword on
    MaxClients 20 "The server is full, hosting %m users"
    DisplayLogin welcome.msg
    DisplayChdir .msg

    Allow from All
    Deny from all

    AllowOverwrite off

     AllowAll


     DenyAll



    User ftp_admin
    Group ftp_admin
    AnonRequirePassword on
    MaxClients 10 "The server is full, hosting %m users"
    DisplayLogin welcome.msg
    DisplayChdir .msg

    Allow from All
    Deny from all

    AllowOverwrite on

     AllowAll


     DenyAll

 

Няма коментари: