ftp est l'outil de base pour accéder aux serveurs ftp. Il ne s'agit pas du meilleur outil, mais il offre toutes les fonctionnalités de base, et est installé par défaut sur la plupart des distributions.
apt-get install ftp
ftp
Vous obtenez une invite :
ftp>
ftp> open 192.168.0.1 Connected to 192.168.0.1. 220 Salut les loulous ! Name (192.168.0.1:fritz): 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files.
Vous remarquerez que ici je n'ai pas spécifié de nom d'utilisateur. En effet, l'utilisateur fritz était proposé par défaut, et c'est ce compte qui m'intéressait.
ftp> pwd 257 "/home/fritz"
ftp> status Connected to 192.168.0.1. No proxy connection. Mode: stream; Type: binary; Form: non-print; Structure: file Verbose: on; Bell: off; Prompting: on; Globbing: on Store unique: off; Receive unique: off Case: off; CR stripping: on Quote control characters: on Ntrans: off Nmap: off Hash mark printing: off; Use of PORT cmds: on Tick counter printing: off
ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. drwxr-xr-x 3 1000 1000 144 Jun 22 21:49 Desktop drwx------ 2 1000 1000 48 Jun 29 13:06 Mail -rw-r--r-- 1 1000 1000 184388 Jun 21 17:22 ndiswrapper-1.18rc1.tar.gz drwxr-xr-x 5 1000 1000 120 Jun 28 11:27 test_svn -rw-r--r-- 1 1000 1000 0 Jun 28 16:01 typescript 226 Directory send OK.
ftp> mkdir tst_4_wiki_ftp 257 "/home/fritz/tst_4_wiki_ftp" created
ftp> cd tst_4_wiki_ftp/ 250 Directory successfully changed.
ftp> lcd /tmp Local directory now /tmp
ftp> put tutu.txt local: tutu.txt remote: tutu.txt 200 PORT command successful. Consider using PASV. 150 Ok to send data. 226 File receive OK. 28 bytes sent in 0.00 secs (479.7 kB/s)
ftp> put tutu.txt jojo.renard local: tutu.txt remote: jojo.renard 200 PORT command successful. Consider using PASV. 150 Ok to send data. 226 File receive OK. 28 bytes sent in 0.00 secs (497.2 kB/s)
ftp> get jojo.renard local: jojo.lapin remote: jojo.renard 200 PORT command successful. Consider using PASV. 150 Opening BINARY mode data connection for jojo.renard (28 bytes). 226 File send OK. 28 bytes received in 0.00 secs (231.7 kB/s)
ftp> mget joj* mget jojo.lapin? y 200 PORT command successful. Consider using PASV. 150 Opening BINARY mode data connection for jojo.lapin (28 bytes). 226 File send OK. 28 bytes received in 0.00 secs (118.4 kB/s) mget jojo.renard? y 200 PORT command successful. Consider using PASV. 150 Opening BINARY mode data connection for jojo.renard (28 bytes). 226 File send OK. 28 bytes received in 0.00 secs (114.4 kB/s)
ftp> rename jojo.renard jojo.lapin 350 Ready for RNTO. 250 Rename successful.
ftp> delete jojo.lapin 250 Delete operation successful.
ftp> rm tst_4_wiki_ftp/ 250 Remove directory operation successful.
ftp> user fritz 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files.