En el shell escribimos:
ftp vsftpd.beasts.org
Connected to vsftpd.beasts.org.
220 sphinx.mythic-beasts.com FTP server ready.
Name (vsftpd.beasts.org:root): anonymous
331 Guest login ok, type your name as password.
Password:
230- Welcome to Mythic Beasts Ltd.
230-
230- This system is for authorised users only. All access is logged.
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
Connected to vsftpd.beasts.org.
220 sphinx.mythic-beasts.com FTP server ready.
Name (vsftpd.beasts.org:root): anonymous
331 Guest login ok, type your name as password.
Password:
230- Welcome to Mythic Beasts Ltd.
230-
230- This system is for authorised users only. All access is logged.
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
Observa como en el campo de nombre de usurio dice: anonymous
Una vez conectados debemos ir a la carpeta users/cevans y de ahí descargar la versión 2.3.4
cd users/cevans
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for '/bin/ls'.
total 6428
-rw-r--r-- 1 530 530 37024 Oct 21 2009 ftpgrab-0.1.3.tar.gz
-rw-r--r-- 1 530 530 37023 Oct 27 2009 ftpgrab-0.1.4.tar.gz
ftp> get vsftpd-2.3.4.tar.gz
local: vsftpd-2.3.4.tar.gz remote: vsftpd-2.3.4.tar.gz
200 PORT command successful.
150 Opening BINARY mode data connection for 'vsftpd-2.3.4.tar.gz' (187043 bytes).
226 Transfer complete.
187043 bytes received in 1.42 secs (128.2 kB/s)
drwxr-x--x 2 530 530 4096 Dec 16 2004 private
drwxr-xr-x 2 530 530 4096 Nov 8 21:00 stuff
drwxr-xr-x 22 530 530 4096 Feb 15 22:39 untar
-rw-r--r-- 1 530 530 90425 Sep 22 2001 vsftpd-0.9.2.tar.gz
-rw-r--r-- 1 530 530 92976 Nov 16 2001 vsftpd-1.0.1.tar.gz
-rw-r--r-- 1 530 530 113205 Jul 31 2002 vsftpd-1.1.0.tar.gz
-rw-r--r-- 1 530 530 115836 Oct 7 2002 vsftpd-1.1.1.tar.gz
-rw-r--r-- 1 530 530 117792 Oct 16 2002 vsftpd-1.1.2.tar.gz
-rw-r--r-- 1 530 530 120817 Nov 9 2002 vsftpd-1.1.3.tar.gz
-rw-r--r-- 1 530 530 130025 May 29 2003 vsftpd-1.2.0.tar.gz
-rw-r--r-- 1 530 530 136041 Nov 13 2003 vsftpd-1.2.1.tar.gz
-rw-r--r-- 1 530 530 136669 Apr 26 2004 vsftpd-1.2.2.tar.gz
-rw-r--r-- 1 530 530 145467 Jul 1 2004 vsftpd-2.0.0.tar.gz
-rw-r--r-- 1 530 530 189 Jul 1 2004 vsftpd-2.0.0.tar.gz.asc
-rw-r--r-- 1 530 530 146231 Jul 2 2004 vsftpd-2.0.1.tar.gz
-rw-r--r-- 1 530 530 189 Jul 2 2004 vsftpd-2.0.1.tar.gz.asc
-rw-r--r-- 1 530 530 151178 Mar 3 2005 vsftpd-2.0.2.tar.gz
-rw-r--r-- 1 530 530 189 Mar 3 2005 vsftpd-2.0.2.tar.gz.asc
-rw-r--r-- 1 530 530 153266 Mar 19 2005 vsftpd-2.0.3.tar.gz
-rw-r--r-- 1 530 530 189 Mar 19 2005 vsftpd-2.0.3.tar.gz.asc
-rw-r--r-- 1 530 530 151811 Mar 5 2005 vsftpd-2.0.3pre1.tar.gz
-rw-r--r-- 1 530 530 152681 Mar 12 2005 vsftpd-2.0.3pre2.tar.gz
-rw-r--r-- 1 530 530 189 Mar 12 2005 vsftpd-2.0.3pre2.tar.gz.asc
-rw-r--r-- 1 530 530 154857 Jan 9 2006 vsftpd-2.0.4.tar.gz
-rw-r--r-- 1 530 530 189 Jan 9 2006 vsftpd-2.0.4.tar.gz.asc
-rw-r--r-- 1 530 530 155985 Jul 3 2006 vsftpd-2.0.5.tar.gz
-rw-r--r-- 1 530 530 189 Jul 3 2006 vsftpd-2.0.5.tar.gz.asc
-rw-r--r-- 1 530 530 158516 Feb 13 2008 vsftpd-2.0.6.tar.gz
-rw-r--r-- 1 530 530 189 Feb 13 2008 vsftpd-2.0.6.tar.gz.asc
-rw-r--r-- 1 530 530 162801 Jul 30 2008 vsftpd-2.0.7.tar.gz
-rw-r--r-- 1 530 530 189 Jul 30 2008 vsftpd-2.0.7.tar.gz.asc
-rw-r--r-- 1 530 530 178636 Feb 18 2009 vsftpd-2.1.0.tar.gz
-rw-r--r-- 1 530 530 197 Feb 18 2009 vsftpd-2.1.0.tar.gz.asc
-rw-r--r-- 1 530 530 180914 May 28 2009 vsftpd-2.1.1.tar.gz
-rw-r--r-- 1 530 530 197 May 28 2009 vsftpd-2.1.1.tar.gz.asc
-rw-r--r-- 1 530 530 180548 Feb 26 2009 vsftpd-2.1.1pre1.tar.gz
-rw-r--r-- 1 530 530 197 Feb 26 2009 vsftpd-2.1.1pre1.tar.gz.asc
-rw-r--r-- 1 530 530 180958 May 29 2009 vsftpd-2.1.2.tar.gz
-rw-r--r-- 1 530 530 197 May 29 2009 vsftpd-2.1.2.tar.gz.asc
-rw-r--r-- 1 530 530 184700 Aug 13 2009 vsftpd-2.2.0.tar.gz
-rw-r--r-- 1 530 530 197 Aug 13 2009 vsftpd-2.2.0.tar.gz.asc
-rw-r--r-- 1 530 530 182050 Jul 7 2009 vsftpd-2.2.0pre1.tar.gz
-rw-r--r-- 1 530 530 197 Jul 7 2009 vsftpd-2.2.0pre1.tar.gz.asc
-rw-r--r-- 1 530 530 184140 Jul 14 2009 vsftpd-2.2.0pre2.tar.gz
-rw-r--r-- 1 530 530 197 Jul 14 2009 vsftpd-2.2.0pre2.tar.gz.asc
-rw-r--r-- 1 530 530 184329 Jul 16 2009 vsftpd-2.2.0pre3.tar.gz
-rw-r--r-- 1 530 530 197 Jul 16 2009 vsftpd-2.2.0pre3.tar.gz.asc
-rw-r--r-- 1 530 530 184420 Jul 18 2009 vsftpd-2.2.0pre4.tar.gz
-rw-r--r-- 1 530 530 197 Jul 18 2009 vsftpd-2.2.0pre4.tar.gz.asc
-rw-r--r-- 1 530 530 185226 Oct 19 2009 vsftpd-2.2.1.tar.gz
-rw-r--r-- 1 530 530 197 Oct 19 2009 vsftpd-2.2.1.tar.gz.asc
-rw-r--r-- 1 530 530 185562 Nov 17 2009 vsftpd-2.2.2.tar.gz
-rw-r--r-- 1 530 530 197 Nov 17 2009 vsftpd-2.2.2.tar.gz.asc
-rw-r--r-- 1 530 530 185554 Nov 12 2009 vsftpd-2.2.2pre1.tar.gz
-rw-r--r-- 1 530 530 197 Nov 12 2009 vsftpd-2.2.2pre1.tar.gz.asc
-rw-r--r-- 1 530 530 187122 Aug 6 2010 vsftpd-2.3.0.tar.gz
-rw-r--r-- 1 530 530 197 Aug 6 2010 vsftpd-2.3.0.tar.gz.asc
-rw-r--r-- 1 530 530 186503 Mar 18 2010 vsftpd-2.3.0pre1.tar.gz
-rw-r--r-- 1 530 530 197 Mar 18 2010 vsftpd-2.3.0pre1.tar.gz.asc
-rw-r--r-- 1 530 530 186992 Mar 26 2010 vsftpd-2.3.0pre2.tar.gz
-rw-r--r-- 1 530 530 197 Mar 26 2010 vsftpd-2.3.0pre2.tar.gz.asc
-rw-r--r-- 1 530 530 187199 Aug 19 2010 vsftpd-2.3.1.tar.gz
-rw-r--r-- 1 530 530 197 Aug 19 2010 vsftpd-2.3.1.tar.gz.asc
-rw-r--r-- 1 530 530 187229 Aug 20 2010 vsftpd-2.3.2.tar.gz
-rw-r--r-- 1 530 530 197 Aug 20 2010 vsftpd-2.3.2.tar.gz.asc
-rw-r--r-- 1 530 530 187001 Feb 15 07:58 vsftpd-2.3.3.tar.gz
-rw-r--r-- 1 530 530 198 Feb 15 07:58 vsftpd-2.3.3.tar.gz.asc
-rw-r--r-- 1 530 530 187043 Feb 15 22:38 vsftpd-2.3.4.tar.gz
-rw-r--r-- 1 530 530 198 Feb 15 22:38 vsftpd-2.3.4.tar.gz.asc
226 Transfer complete.
ftp> get vsftpd-2.3.4.tar.gz
local: vsftpd-2.3.4.tar.gz remote: vsftpd-2.3.4.tar.gz
200 PORT command successful.
150 Opening BINARY mode data connection for 'vsftpd-2.3.4.tar.gz' (187043 bytes).
226 Transfer complete.
187043 bytes received in 1.42 secs (128.2 kB/s)
Verificar firma del tarball:
Para esto debemos descargar el archivo *.asc
¿Qué es asc http://www.fileinfo.com/extension/asc ?
juan@Jaguar:~/ftp$ gpg vsftpd-2.3.4.tar.gz.asc
gpg: Firmado el mar 15 feb 2011 16:38:11 CST usando clave DSA ID 3C0E751C
gpg: Imposible comprobar la firma: Clave pública no encontrada
Debemos conseguir la llave pública del sitio
Probemos...
juan@Jaguar:~/ftp$ gpg vsftpd-2.3.4.tar.gz.asc
gpg: Firmado el mar 15 feb 2011 16:38:11 CST usando clave DSA ID 3C0E751C
gpg: Imposible comprobar la firma: Clave pública no encontrada
Hay qué conseguirla, quizás en el keyserver del MIT
juan@Jaguar:~/ftp$ gpg --keyserver pgpkeys.mit.edu --recv-key 3C0E751C
gpg: solicitando clave 3C0E751C de hkp servidor pgpkeys.mit.edu
gpg: clave 3C0E751C: clave pública "Chris Evans " importada
gpg: Cantidad total procesada: 1
gpg: importadas: 1
vientos!
juan@Jaguar:~/ftp$ gpg vsftpd-2.3.4.tar.gz.asc
gpg: Firmado el mar 15 feb 2011 16:38:11 CST usando clave DSA ID 3C0E751C
gpg: Firma correcta de «Chris Evans »
gpg: AVISO: ¡Esta clave no está certificada por una firma de confianza!
gpg: No hay indicios de que la firma pertenezca al propietario.
Huellas dactilares de la clave primaria: 8660 FD32 91B1 84CD BC2F 6418 AA62 EC46 3C0E 751C
Conformémonos con esto.
ahora, compilemos el código fuente
descomir el tar
leer el archivo INSTALL
Atención a lo siguiente: (sacado del archivo INSTALL)
edit "builddefs.h" to handle compile-time settings (tcp_wrappers build,
etc).
Compilación:
Just type "make" (and mail me to fix it if it doesn't build ;-).
This should produce you a vsftpd binary. You can test for this, e.g.:
Step 2) Satisfy vsftpd pre-requisites
2a) vsftpd needs the user "nobody" in the default configuration. Add this
user in case it does not already exist. e.g.:
[root@localhost root]# useradd nobody
useradd: user nobody exists
2b) vsftpd needs the (empty) directory /usr/share/empty in the default
configuration. Add this directory in case it does not already exist. e.g.:
[root@localhost root]# mkdir /usr/share/empty/
mkdir: cannot create directory `/usr/share/empty': File exists
2c) For anonymous FTP, you will need the user "ftp" to exist, and have a
valid home directory (which is NOT owned or writable by the user "ftp").
The following commands could be used to set up the user "ftp" if you do not
have one:
[root@localhost root]# mkdir /var/ftp/
[root@localhost root]# useradd -d /var/ftp ftp
(the next two are useful to run even if the user "ftp" already exists).
[root@localhost root]# chown root.root /var/ftp
[root@localhost root]# chmod og-w /var/ftp
Instalación, a pata
cp vsftpd /usr/sbin/vsftpd
cp vsftpd.conf.5 /usr/share/man/man5
cp vsftpd.8 /usr/share/man/man8
"make install" doesn't copy the sample config file. It is recommended you
do this:
cp vsftpd.conf /etc
probemos...
Edit /etc/vsftpd.conf, and add this line at the bottom:
listen=YES
This tells vsftpd it will NOT be running from inetd.
Right, now let's try and run it!
Probemos
Ir a donde se instaló vsftpd i.e. /usr/sbin/
root@Jaguar:/usr/sbin# ftp localhost
Connected to localhost.
220 (vsFTPd 2.3.4)
Name (localhost:root): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
Instalción con inetd
Hagamos todo el chunche.
Inet: Often called a super-server, inetd listens on designated ports used by internet services such as FTP, POP3, and telnet. When a TCP packet or UDP packet arrives with a particular destination port number, inetd launches the appropriate server program to handle the connection.
gopher:
The Gopher protocol /ˈɡoʊfər/ is aTCP/IP Application layer protocoldesigned for distributing, searching, and retrieving documents over the Internet. Strongly oriented towards a menu-document design, the Gopher protocol was a predecessor of (and later, an alternative to) the World Wide Web.
The Gopher protocol was first described in RFC 1436. IANA has assigned TCPport 70 to the Gopher protocol.
Setup
The file /etc/services is used to map port numbers and protocols to service names, and the file /etc/inetd.conf is used to map service names to server names. For example, if a TCP request comes in on port 23, /etc/services shows
telnet 23/tcp
The corresponding line in the /etc/inetd.conf file (in this case, taken from a machine running AIX version 5.1) is
telnet stream tcp6 nowait root /usr/sbin/telnetd telnetd -a
This tells inetd to launch the program /usr/sbin/telnetd with the command line arguments telnetd -a. inetd automatically hooks the socket to stdin, stdout, and stderr of the server program.
Generally TCP sockets are handled by spawning a separate server to handle each connection concurrently. UDP sockets are generally handled by a single server instance that handles all packets on that port.
i.e. TENEMOS QUE MODIFICAR /etc/services y /etc/inetd.conf
5a) If using standard "inetd", you will need to edit /etc/inetd.conf, and add
a line such as:
ftp stream tcp nowait root /usr/sbin/tcpd /usr/local/sbin/vsftpd
(Make sure to remove or comment out any existing ftp service lines. If you
don't have tcp_wrappers installed, or don't want to use them, take out the
/usr/sbin/tcpd part).
inetd will need to be told to reload its config file:
kill -SIGHUP `pidof inetd`
5b) If using "xinetd", you can follow a provided example, by looking at the
file EXAMPLE/INTERNET_SITE/README. Various other examples show how to leverage
the more powerful xinetd features.
No hay comentarios:
Publicar un comentario