ftp
$ sudo aptitude install proftpd $ sudo /etc/init.d/proftpd start $ sudo adduser (user: foo pw: bar)
examples/net/ftp.py
from ftplib import FTP ftp = FTP('localhost') ftp.login("foo", "bar") print(ftp.retrlines('LIST')) print('-------') for f in ftp.nlst(): print("file: " + f) filename = 'ssh.py' ftp.storlines("STOR " + filename, open(filename)) print('-------') for f in ftp.nlst(): print("file: " + f) ftp.delete(filename) print('-------') for f in ftp.nlst(): print("file: " + f)
-rw-rw-r-- 1 foo foo 6 Feb 18 19:18 a.txt -rw-rw-r-- 1 foo foo 6 Feb 18 19:18 b.txt 226 Transfer complete ------- file: b.txt file: a.txt ------- file: b.txt file: a.txt file: ssh.py ------- file: b.txt file: a.txt