{"id":19423279,"url":"https://github.com/atomjoy/vps","last_synced_at":"2025-04-24T16:30:47.498Z","repository":{"id":58793336,"uuid":"533726154","full_name":"atomjoy/vps","owner":"atomjoy","description":"Konfiguracja serwera VPS Debian 11 w ovh podstawy (ger).","archived":false,"fork":false,"pushed_at":"2023-01-25T13:02:44.000Z","size":104,"stargazers_count":4,"open_issues_count":0,"forks_count":14,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T07:21:51.209Z","etag":null,"topics":["certbot-ssl","debian","debian-certbot","debian-lemp","debian-php8","https","nginx","tls","vps-debian","vps-installation","vps-lemp","vps-postfix-send-only","vps-security","vps-server","vps-setup","vps-sshkeys","vps-ssl","vps-ufw-firewall"],"latest_commit_sha":null,"homepage":"https://github.com/atomjoy/vps","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomjoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-07T10:59:43.000Z","updated_at":"2024-06-13T18:02:08.000Z","dependencies_parsed_at":"2023-02-14T07:45:29.675Z","dependency_job_id":null,"html_url":"https://github.com/atomjoy/vps","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fvps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fvps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fvps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fvps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomjoy","download_url":"https://codeload.github.com/atomjoy/vps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250663544,"owners_count":21467366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certbot-ssl","debian","debian-certbot","debian-lemp","debian-php8","https","nginx","tls","vps-debian","vps-installation","vps-lemp","vps-postfix-send-only","vps-security","vps-server","vps-setup","vps-sshkeys","vps-ssl","vps-ufw-firewall"],"created_at":"2024-11-10T13:37:39.983Z","updated_at":"2025-04-24T16:30:47.244Z","avatar_url":"https://github.com/atomjoy.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Konfiguracja serwera VPS z sytemem Debian 11\nKonfiguracja serwera VPS Debian 11 z ovh (LEMP, Letsencrypt certbot, logowanie z kluczami ssh, serwer smtp do wysyłania wiadomości email, ufw firewall).\n\n## Pobierz z git\n```sh\nsudo apt install git\ngit clone https://github.com/atomjoy/vps.git\n```\n\n## Strefa DNS\n```\nUtwórz recordy A w strefie DNS dla hostów swojej domeny (certbot ssl):\nhello.example.com \nwww.hello.example.com\n```\n\n## Uruchom jako root\n```sh\n# Utwórz hasło root\nsudo passwd root\n\n# Zaloguj jako root\nsu\n\n# Zmień hasło użytkownika debian (opcjonalnie)\nsudo passwd debian\n```\n\n## Klucze ssh\n```sh\n# Utwórz klucz rsa ~/.ssh/id_rsa\nssh-keygen -t rsa -C \"your_email@example.com\"\nssh-keygen -t rsa -b 4096 -C \"your_email@example.com\"\n\n# Utwórz klucz Ed25519 (można użyć do logowania na githuba np.)\nssh-keygen -t ed25519 -C \"your_email@example.com\"\n\n# Wyślij na serwer\nssh-copy-id -i ~/.ssh/id_rsa.pub $vps_user@$vps_host_or_ip\n```\n\n## Ustawienia serwera ssh\nLogowanie tylko z kluczami ssh, bez hasła i logowania na root.\n```sh\n# Ustaw wcześniej klucze ssh dla zalogowanego użytkownika !!!\nsudo bash ssh.sh\n```\n\n## Uruchom skrypty jako root\nNie zapomij zmienić ustawienia w każdym skrypcie (variables) !!!\n\n1. sudo bash hostname.sh\n2. sudo bash ssl-snakeoil.sh\n3. sudo bash apt-https.sh\n4. sudo bash ufw.sh\n5. sudo bash php.sh\n6. sudo bash nginx.sh\n7. sudo bash certbot.sh\n8. sudo bash nginx-vhost.sh\n9. sudo bash postfix.sh\n10. sudo bash mariadb.sh\n11. sudo bash remove-sudo-default-user.sh\n\n## Usuwanie użytkownika debian z sudo\n```bash\nsudo bash remove-sudo-user.sh\n```\n\n## Hostname\n```bash\n# Hostname\nsudo hostnamectl set-hostname hello.example.com\n\n# Change hosts etc/hosts\n127.0.0.1 example.com hello.example.com hello localhost\n```\n\n## Połączenia i certyfikaty\n```sh\n# Certyfikat snakeoil\nsudo apt install ssl-cert\n\n# Aktualizacja certyfikatu snakeoil\nsudo make-ssl-cert generate-default-snakeoil --force-overwrite\n\n# Podgląd certyfikatu ssl\nopenssl x509 -noout -subject -in /etc/ssl/certs/ssl-cert-snakeoil.pem\n\n# Połącz z serwerem smtp :25 :578\nopenssl s_client -starttls smtp -crlf -connect 127.0.0.1:25\n\n# Połącz z serwerem smtp\ntelnet localhost 25\n\n# Test http/https\n wget --no-check-certificate https://example.com\n```\n\n## Usuń linię zawierającą tekst z pliku\n```sh\nsed -i '/inet_interfaces/d' /etc/postfix/main.cf\n```\n\n## Wyślij email z cmd\n```sh\nsudo apt install mailutils postfix\n\n# Linux mail\necho \"Test email `date`\" | mail -s \"Welcome today is `date`\" your_email@gmail.com\n\n# Linux mailx\necho \"From test `date`\" | mailx -s \"From address test\" -a 'From: Admin Root \u003croot@example.com\u003e' your_email@gmail.com\n\n# With bash MAILNAME=example.com\necho \"From test `date`\" | mailx -s \"Welcome message `date`\" -a \"From: Admin Root \u003croot@${MAILNAME}\u003e\" $TESTMAIL\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomjoy%2Fvps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomjoy%2Fvps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomjoy%2Fvps/lists"}