apuntes:servicios_transferencia
This is an old revision of the document!
Table of Contents
Servicios de transferencia de archivos
Servicio FTP (File Transfer Protocol)
El protocolo FTP (File Transfer Protocol) es un protocolo utilizado para la transferencia de ficheros entre una máquina local y otra remota. Básicamente son dos operaciones las que se pueden realizar, subir ficheros a la máquina remota o bien descargarlos. Además existen más comandos pero se utilizan para manejarse dentro del servidor con el objetivo de poder navegar por la estructura de directorios, crear nuevos, eliminar ficheros y alguna otra tarea.

Servidores FTP
santi@zenbook:$ sudo apt-get install proftpd
- /etc/proftpd/proftpd.conf
. . . Include /etc/proftdp/modules.conf ServerName "Debian" DisplayLogin welcome.msg Port 21 . . .
Servidores SFTP
santi@zenbook:$ sudo apt-get install openssh-server openssh-sftp-server
Clientes FTP
santi@zenbook:$ ftp misitio.com Connected to misitio.com. 220 ProFTPD 1.3.5b Server (Debian) [::ffff:127.0.0.1] Name (misitio.com:santi): santi 331 Password required for santi Password: 230 User santi logged in Remote system type is UNIX. Using binary mode to transfer files. ftp> |
ftp> help Commands may be abbreviated. Commands are: ! dir mdelete qc site $ disconnect mdir sendport size account exit mget put status append form mkdir pwd struct ascii get mls quit system bell glob mode quote sunique binary hash modtime recv tenex bye help mput reget tick case idle newer rstatus trace cd image nmap rhelp type cdup ipany nlist rename user chmod ipv4 ntrans reset umask close ipv6 open restart verbose cr lcd prompt rmdir ? delete ls passive runique debug macdef proxy send
Comando | Descripción |
---|---|
bye | Cierra la sesión FTP |
cd | Cambia de directorio en la máquina remota |
delete | Elimina un fichero en la máquina remota |
get | Descarga un fichero de la máquina remota |
lcd | Cambia/Muestra directorio en la máquina local |
ls | Lista el contenido de un directorio de la máquina remota |
mdelete | Elimina múltiples ficheros en la máquina remota |
mkdir | Crea un directorio en la máquina remota |
mput | Sube múltiples ficheros a la máquina remota |
prompt | Activa/Desactiva interacción en operaciones múltiples |
put | Sube un fichero a la máquina remota |
pwd | Muestra el directorio activo en la máquina remota |
rmdir | Elimina un directorio en la máquina remota |
verbose | Activa/Desactiva mostrar mensajes |
Table 1: Resumen de comandos FTP
ftp> help rmdir rmdir remove directory on the remote machine
santi@zenbook:$ sftp misitio.com The authenticity of host 'misitio.com (::1)' cannot be established. ECDSA key fingerprint is SHA256:B5y+uH5grBUJRLnN5ZNMvKHS4USELBfv5J2Gyf+s37s. Are you sure you want to continue connecting (yes/no)?
sftp> help Available commands: bye Quit sftp cd path Change remote directory to 'path' chgrp grp path Change group of file 'path' to 'grp' chmod mode path Change permissions of file 'path' to 'mode' chown own path Change owner of file 'path' to 'own' df [-hi] [path] Display statistics for current directory or filesystem containing 'path' exit Quit sftp get [-afPpRr] remote [local] Download file reget [-fPpRr] remote [local] Resume download file reput [-fPpRr] [local] remote Resume upload file help Display this help text lcd path Change local directory to 'path' lls [ls-options [path]] Display local directory listing lmkdir path Create local directory ln [-s] oldpath newpath Link remote file (-s for symlink) lpwd Print local working directory ls [-1afhlnrSt] [path] Display remote directory listing lumask umask Set local umask to 'umask' mkdir path Create remote directory progress Toggle display of progress meter put [-afPpRr] local [remote] Upload file pwd Display remote working directory quit Quit sftp rename oldpath newpath Rename remote file rm path Delete remote file rmdir path Remove remote directory symlink oldpath newpath Symlink remote file version Show SFTP version !command Execute 'command' in local shell ! Escape to local shell ? Synonym for help sftp>
santi@zenbook:$ sftp misitio.com @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is SHA256:B5y+uH5grBUJRLnN5ZNMvKHS4USELBfv5J2Gyf+s37s. Please contact your system administrator. Add correct host key in /home/santi/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /home/santi/.ssh/known_hosts:3 remove with: ssh-keygen -f "/home/santi/.ssh/known_hosts" -R misitio.com ECDSA host key for misitio.com has changed and you have requested strict checking. Host key verification failed. Couldn't read packet: Connection reset by peer
santi@zenbook:$ ssh-keygen -f "/home/santi/.ssh/known_hosts" -R misitio.com # Host misitio.com found: line 13 /home/santi/.ssh/known_hosts updated. Original contents retained as /home/santi/.ssh/known_hosts.old


Servicio SSH (Secure SHell)
Servidores SSH
santi@zenbook:$ sudo apt-get install openssh-server
Clientes SSH
santi@zenbook:$ sudo apt-get install openssh-client
Protocolo SCP (Secure CoPy)
santi@zenbook:$ scp -r misitio santi@misitio.com:/var/www/html
Ejercicios
Proyectos de Ejemplo
Prácticas
© 2017 Santiago Faci
apuntes/servicios_transferencia.1506459705.txt.gz · Last modified: 2019/01/04 13:02 (external edit)