Now Reading: GitHub Action SSH Değerleri VPS kurulumu (ubuntu)

Loading

G

11/11/2025 / gadasi

GitHub Action SSH Değerleri VPS kurulumu (ubuntu)

svg12

1) Deploy kullanıcısı (ör: kitmotedeploy)

sudo adduser kitmotedeploy
sudo usermod -aG www-data kitmotedeploy

2) Yetkiler

sudo chown -R kitmotedeploy:www-data /var/www/kitmote
sudo find /var/www/kitmote -type d -exec chmod 775 {} \;
sudo find /var/www/kitmote -type f -exec chmod 664 {} \;

Sunucuda (mothership kullanıcısı için) anahtar üret

sudo -u kitmotedeploy ssh-keygen -t ed25519 -C “github-actions@kitmotedeploy” -f /home/kitmote/.ssh/id_ed25519

Public anahtarı authorized_keys’e ekle

sudo -u kitmotedeploy ssh-keygen -t ed25519 -C “gh-actions@kitmotedeploy” -f /home/kitmote/.ssh/gh_actions -N “”
sudo chown kitmotedeploy:kitmote /home/kitmote/.ssh/authorized_keys
sudo chmod 600 /home/kitmote/.ssh/authorized_keys
sudo chmod 700 /home/kitmote/.ssh

Private anahtarı al (GitHub Secret’a koyacaksın)

sudo cat /home/kitmote/.ssh/id_ed25519

Private key artık GitHub’da olduğu için sunucuda tutmak zorunda değilsin:

sudo -u kitmotedeploy shred -u /home/kitmote/.ssh/id_ed25519

Github Değerleri:

GitHub repo → Settings → Secrets and variables → Actions bölümünde

SSH_HOST: (ip adresi)

SSH_KEY: sudo cat /home/kitmote/.ssh/id_ed25519 buradan gelen bütün değer.

SSH_PORT: 22

DEPLOY_PATH: /var/www/…

Loading
svg

Quick Navigation

  • 1

    GitHub Action SSH Değerleri VPS kurulumu (ubuntu)