1. Komut Satırıyla FTP Bağlantısı (Windows/Linux/macOS)
ftp ftp.sunucuadi.com
Giriş yaptıktan sonra:
Username: kullaniciadi
Password: sifre
Dosya indirmek için:
get dosya.txt
Dosya yüklemek için:
put yerel_dosya.txt
🐍 2. Python ile FTP Dosya Yükleme (ftplib)
from ftplib import FTP
ftp = FTP('ftp.sunucuadi.com')
ftp.login(user='kullaniciadi', passwd='sifre')
with open('dosya.txt', 'rb') as file:
ftp.storbinary('STOR dosya.txt', file)
ftp.quit()
Bu kod, dosya.txt
adlı yerel dosyayı sunucuya yükler.
🖥️ 3. vsftpd ile FTP Sunucusu Kurulumu (Ubuntu)
sudo apt update
sudo apt install vsftpd
Yapılandırma dosyasını düzenle:
sudo nano /etc/vsftpd.conf
Önerilen ayarlar:
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
Servisi yeniden başlat:
sudo systemctl restart vsftpd
🔐 4. Güvenli FTP (SFTP) ile Bağlantı
SFTP, SSH üzerinden çalışır. Bağlantı için:
sftp kullaniciadi@sunucuadi.com
Dosya yüklemek:
put dosya.txt
Dosya indirmek:
get dosya.txt