1. Komut Satırıyla FTP Bağlantısı (Windows/Linux/macOS)
bash
ftp ftp.sunucuadi.com
Giriş yaptıktan sonra:
bash
Username: kullaniciadi
Password: sifre
Dosya indirmek için:
bash
get dosya.txt
Dosya yüklemek için:
bash
put yerel_dosya.txt
🐍 2. Python ile FTP Dosya Yükleme (ftplib)
python
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)
bash
sudo apt update
sudo apt install vsftpd
Yapılandırma dosyasını düzenle:
bash
sudo nano /etc/vsftpd.conf
Önerilen ayarlar:
conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
Servisi yeniden başlat:
bash
sudo systemctl restart vsftpd
🔐 4. Güvenli FTP (SFTP) ile Bağlantı
SFTP, SSH üzerinden çalışır. Bağlantı için:
bash
sftp kullaniciadi@sunucuadi.com
Dosya yüklemek:
bash
put dosya.txt
Dosya indirmek:
bash
get dosya.txt
