Pagina 1 di 1

RISOLTO Slack 12.2 e proftpd

Inviato: sab 17 gen 2009, 15:01
da nevermind
salve gente ho un piccolo problema con proftpd.

in pratica voglio mettere su un ftp server con l'autenticazione e altre cose attraverso mysql, nulla di strano solo che se scarico i sorgenti dal sito proftpd e li compilo con i vari moduli la versione stabile nn s'installa (credo conflitti con le inclcudes della nuova slack) e la versione in sviluppo nn gira bene.

ora come faccio a dare le direttive d'installazione (./configure --with-modules=....... ecc....) al pacchetto tgz della 12.2?

qualcuno sa aiutarmi?
grazie a tutti.

Re: Slack 12.2 e proftpd

Inviato: sab 17 gen 2009, 19:39
da neongen
scarichi i sorgenti del pacchetto, modifichi lo slackbuild, ricompili e reinstalli

Re: Slack 12.2 e proftpd

Inviato: sab 17 gen 2009, 20:33
da nevermind
neogen grazie per la risposta ma..... sn a digiuno di modifiche dello slackbuil e ricomplilazione dello stesso :oops: potresti darmi maggiori indicazioni perfavore? grazie.

Re: Slack 12.2 e proftpd

Inviato: sab 17 gen 2009, 21:55
da neongen
s4d

scarichi tutta la roba che trovi al link che ti ho postato prima,
nel file proftpd.SlackBuild trovi le righe (./configure --with-modules=....... ecc....) che ti interessano, modifichi come serve a te e poi da root esegui "sh proftpd.SlackBuild", alla fine viene generato un tgz che puoi dare in pasto ad upgradepkg

Re: Slack 12.2 e proftpd

Inviato: dom 18 gen 2009, 16:05
da nevermind
grazie per le info sn riuscito ad installare il tutto come volevo....... ora xò ho un altro piccolo problemino.... :oops: in pratica lancio il demone in standalone dandogli le direttive del file di conf

Codice: Seleziona tutto

# proftpd -c /etc/proftpd.conf
solo che sembra nn utilizzare il file dato che 1 il messaggio del server name nn è quello che impostato io e 2 nn si collega al db di mysql....

ti posto il file di config di proftpd:

Codice: Seleziona tutto

# This is a basic ProFTPD configuration file.
# It establishes a single server and a single anonymous login.
# It assumes that you have a user/group "nobody" and "ftp" 
# for normal/anonymous operation.

ServerName			"Zack ProFTPD Server"
ServerType			standalone
#ServerType			inetd
DefaultServer			on
DeferWelcome			on
AllowStoreRestart		on
MultilineRFC2228		on
ShowSymlinks			on
TimeoutNoTransfer		600
TimeoutStalled			600
TimeoutIdle			1200
ListOptions			"-1"
DenyFilter			\*.*/

# Port 21 is the standard FTP port.
Port				21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask				022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances			30

# Set the user and group that the server normally runs at.
User				ftpuser
Group			ftp

# This next option is required for NIS or NIS+ to work properly:
#PersistentPasswd off

SystemLog			/var/log/proftpd.log
TransferLog			/var/log/xferlog

# Normally, we want files to be overwriteable.
<Directory /*>
  AllowOverwrite		on
</Directory>

#To cause every FTP user to be "jailed" (chrooted) into their home directory, uncomment this line
DefaultRoot ~

<Global>
	SQLConnectInfo proftpd@localhost proftpd mia_passwd
	SQLAuthenticate users* groups*
	SQLAuthTypes Backend Plaintext Crypt
	SQLUserInfo ftpuser userid passwd uid gid homedir shell
	SQLGroupInfo ftp groupname gid members
	SQLMinID 50
	SQLLog PASS updatecount
	SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser
	SQLLog STOR,DELE modified
	SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
	SQLLog RETR,STOR,APPE,STOU transfer_success
	SQLNamedQuery transfer_success INSERT "'%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'c'" xfer_stats
	SQLLog ERR_RETR,ERR_STOR,ERR_APPE,ERR_STOU transfer_error
	SQLNamedQuery transfer_error INSERT "'%u', '%f', '%b', '%h', '%a', '%m','%T', now(), 'i'" xfer_stats
</Global>

# A basic anonymous FTP server configuration.
# To enable this, remove the user ftp from /etc/ftpusers.
<Anonymous ~ftp>
  RequireValidShell		off
  User				ftp
  Group				ftp
  # We want clients to be able to login with "anonymous" as well as "ftp"
  UserAlias			anonymous ftp

  # Limit the maximum number of anonymous logins
  MaxClients			50

  # We want 'welcome.messaggio' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  DisplayLogin			welcome.messaggio
  DisplayChdir			.message

  # Limit WRITE everywhere in the anonymous chroot
  <Limit WRITE>
    DenyAll
  </Limit>

  # An upload directory that allows storing files but not retrieving
  # or creating directories.
#  <Directory incoming/*>
#    <Limit READ>
#      DenyAll
#    </Limit>
#
#    <Limit STOR>
#      AllowAll
#    </Limit>
#  </Directory>

</Anonymous>
questo invece è quello che mi risponde la console

Codice: Seleziona tutto

root@Slackware:~# proftpd -c /etc/proftpd.conf
root@Slackware:~# ftp localhost
Connected to localhost.
220 ProFTPD 1.3.1 Server ready.
Name (localhost:root): admin
421 Service not available, remote server has closed connection
Login failed.
No control connection for command: No such file or directory
ftp>
e questo è il log di proftpd

Codice: Seleziona tutto

Jan 18 16:01:34 Slackware proftpd[3262] Slackware.workgroup: ProFTPD 1.3.1 (stable) (built Sun Jan 18 14:45:27 CET 2009) standalone mode STARTUP
Jan 18 16:01:57 Slackware proftpd[3270] Slackware.workgroup (localhost[::ffff:127.0.0.1]): FTP session opened.
Jan 18 16:02:02 Slackware proftpd[3270] Slackware.workgroup (localhost[::ffff:127.0.0.1]): FTP session closed.
gli daresti un'occhiata?

grazie.

Re: Slack 12.2 e proftpd

Inviato: dom 18 gen 2009, 16:53
da nevermind
AGGIORNAMENTO

allora adesso riesco a fare l'accesso al server con il login, ho fatto le seguenti modifiche a proftpd.conf

Codice: Seleziona tutto

#<Global>
	SQLAuthenticate on
	SQLConnectInfo proftpd@localhost proftpd re.divivo1
	SQLAuthenticate users* groups*
	SQLAuthTypes Crypt Backend Plaintext
	SQLUserInfo ftpuser userid passwd uid gid homedir shell
	SQLGroupInfo ftp groupname gid members
	SQLMinID 50
	SQLLog PASS updatecount
	SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser
	SQLLog STOR,DELE modified
	SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
	SQLLog RETR,STOR,APPE,STOU transfer_success
	SQLNamedQuery transfer_success INSERT "'%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'c'" xfer_stats
	SQLLog ERR_RETR,ERR_STOR,ERR_APPE,ERR_STOU transfer_error
	SQLNamedQuery transfer_error INSERT "'%u', '%f', '%b', '%h', '%a', '%m','%T', now(), 'i'" xfer_stats
	RequireValidShell off
#</Global>
in parole povere ho eliminato i tag <Global></Global> e ho aggiunto alle istruzioni "SQLAuthenticate on" e "RequireValidShell off" ora mi restano solo 2 cose che nn vanno

1 -la stringa Server Name nn viene ancora visualizzata, c'è ancora quella standard "ProFTPD 1.3.1 Server ready."
2 -nel db mysql ho inserito un utente con passwd crittata e uno con passwd in chiaro beh.... quello con la passwd in chiaro entra quello con quella crittata no e nel log mi dice che nn trova l'utente.

help me please....

grazie.

Re: Slack 12.2 e proftpd

Inviato: dom 18 gen 2009, 16:57
da neongen
guarda che "Zack ProFTPD Server" dovrebbe essere visualizzato dal client quando si connette, non dalla console

edit: per mysql non so

Re: Slack 12.2 e proftpd

Inviato: dom 18 gen 2009, 17:55
da nevermind
RISOLTO

posto il file di config di proftpd esatto

Codice: Seleziona tutto

# This is a basic ProFTPD configuration file.
# It establishes a single server and a single anonymous login.
# It assumes that you have a user/group "nobody" and "ftp" 
# for normal/anonymous operation.

ServerName			"Zack ProFTPD Server"
ServerType			standalone
#ServerType			inetd
DefaultServer			on
DeferWelcome			off
AllowStoreRestart		off
MultilineRFC2228		on
ShowSymlinks			on
TimeoutNoTransfer		600
TimeoutStalled			600
TimeoutIdle			1200
ListOptions			"-l"
DenyFilter			\*.*/
UseIPv6				off

# Port 21 is the standard FTP port.
Port				21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask				022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances			30

# Set the user and group that the server normally runs at.
User				ftpuser
Group				ftp

# This next option is required for NIS or NIS+ to work properly:
#PersistentPasswd off

SystemLog			/var/log/proftpd.log
TransferLog			/var/log/xferlog

# Normally, we want files to be overwriteable.
<Directory /*>
  AllowOverwrite		on
</Directory>

#To cause every FTP user to be "jailed" (chrooted) into their home directory, uncomment this line
DefaultRoot ~

	SQLAuthenticate on
	SQLConnectInfo proftpd@localhost proftpd mia_passwd
	SQLAuthenticate users* groups*
	SQLAuthTypes Crypt Backend Plaintext
	SQLUserInfo ftpuser userid passwd uid gid homedir shell
	SQLGroupInfo ftp groupname gid members
	SQLMinID 50
	SQLLog PASS updatecount
	SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser
	SQLLog STOR,DELE modified
	SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
	SQLLog RETR,STOR,APPE,STOU transfer_success
	SQLNamedQuery transfer_success INSERT "'%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), 'c'" xfer_stats
	SQLLog ERR_RETR,ERR_STOR,ERR_APPE,ERR_STOU transfer_error
	SQLNamedQuery transfer_error INSERT "'%u', '%f', '%b', '%h', '%a', '%m','%T', now(), 'i'" xfer_stats
	RequireValidShell off

# A basic anonymous FTP server configuration.
# To enable this, remove the user ftp from /etc/ftpusers.
<Anonymous ~ftp>
  RequireValidShell		off
  User				ftp
  Group				ftp
  # We want clients to be able to login with "anonymous" as well as "ftp"
  UserAlias			anonymous ftp

  # Limit the maximum number of anonymous logins
  MaxClients			50

  # We want 'welcome.messaggio' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  DisplayLogin			welcome.messaggio
  DisplayChdir			.message

  # Limit WRITE everywhere in the anonymous chroot
  <Limit WRITE>
    DenyAll
  </Limit>

  # An upload directory that allows storing files but not retrieving
  # or creating directories.
#  <Directory incoming/*>
#    <Limit READ>
#      DenyAll
#    </Limit>
#
#    <Limit STOR>
#      AllowAll
#    </Limit>
#  </Directory>

</Anonymous>
e in più il comando mysql per inserire gli user nel db con passwd criptata

Codice: Seleziona tutto

mysql> INSERT INTO `ftpuser` VALUES (1, 'user', ENCRYPT('passwd'), 50, 50, '/home/ftp/virtual/user', '/sbin/nologin',0,'','');
grazie di tutto ciao :)