Tüm Rehberler

Linux VPS Sunucu Kurulumu (Ubuntu)

Ubuntu tabanlı VPS sunucunuzu sıfırdan yapılandırın. Güvenlik, kullanıcı yönetimi ve temel ayarlar.

Orta30 dk

Kurulum Adımları

1. VPS'e SSH ile bağlanın:

ssh root@sunucu_ip_adresi

2. Sistemi güncelleyin:

apt update && apt upgrade -y

3. Yeni bir kullanıcı oluşturun:

adduser yenikullanici
usermod -aG sudo yenikullanici

4. SSH anahtar tabanlı kimlik doğrulamayı yapılandırın:

mkdir -p /home/yenikullanici/.ssh
cp ~/.ssh/authorized_keys /home/yenikullanici/.ssh/
chown -R yenikullanici:yenikullanici /home/yenikullanici/.ssh
chmod 700 /home/yenikullanici/.ssh
chmod 600 /home/yenikullanici/.ssh/authorized_keys

5. SSH yapılandırmasını güçlendirin (/etc/ssh/sshd_config):

PermitRootLogin no
PasswordAuthentication no
Port 2222

6. SSH'ı yeniden başlatın:

systemctl restart sshd

7. UFW güvenlik duvarını etkinleştirin:

ufw allow 2222/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable

8. Zaman dilimini ayarlayın:

timedatectl set-timezone Europe/Istanbul

9. Swap alanı oluşturun (2GB):

fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab