{"id":152,"title":"Alpine Linux kurulumundan sonras\u0131","content":"<p>Alpine Linux kurulumundan sonra temel kurulumlar\u0131 otomatik yapmak i\u00e7in a\u015fa\u011f\u0131daki bash scripti kullanabilirsiniz<\/p><p>&nbsp;<\/p><p>```bash<br>#!\/bin\/bash<\/p><p># Alpine Linux After Install Script<br># Bu betik Alpine Linux kurulumundan sonra temel yap\u0131land\u0131rmalar\u0131 yapar<\/p><p># Hata durumunda beti\u011fi durdur<br>set -e<\/p><p># Renk kodlar\u0131<br>RED='\\033; then<br>&nbsp; echo -e \"${RED}Bu betik root yetkisi gerektirir${NC}\"<br>&nbsp; exit 1<br>fi<\/p><p># Fonksiyonlar<br>print_message() {<br>&nbsp; &nbsp;echo -e \"${GREEN}==&gt;${NC} $1\"<br>}<\/p><p>print_warning() {<br>&nbsp; &nbsp;echo -e \"${YELLOW}==&gt;${NC} $1\"<br>}<\/p><p># Repository g\u00fcncelleme<br>update_system() {<br>&nbsp; &nbsp;print_message \"Sistem g\u00fcncelleniyor...\"<br>&nbsp; &nbsp;cat &gt; \/etc\/apk\/repositories &lt;&lt; EOF<br>http:\/\/dl-cdn.alpinelinux.org\/alpine\/v3.19\/main<br>http:\/\/dl-cdn.alpinelinux.org\/alpine\/v3.19\/community<br>EOF<br>&nbsp; &nbsp;apk update &amp;&amp; apk upgrade<br>}<\/p><p># Temel paketlerin kurulumu<br>install_base_packages() {<br>&nbsp; &nbsp;print_message \"Temel paketler kuruluyor...\"<br>&nbsp; &nbsp;apk add sudo vim curl wget git htop bash \\<br>&nbsp; &nbsp; &nbsp; &nbsp;net-tools iputils openssh lsblk usbutils \\<br>&nbsp; &nbsp; &nbsp; &nbsp;pciutils nano tmux tree<br>}<\/p><p># Kullan\u0131c\u0131 olu\u015fturma<br>create_user() {<br>&nbsp; &nbsp;print_message \"Yeni kullan\u0131c\u0131 olu\u015fturuluyor...\"<br>&nbsp; &nbsp;read -p \"Kullan\u0131c\u0131 ad\u0131: \" username<br>&nbsp; &nbsp;adduser $username<br>&nbsp; &nbsp;addgroup $username wheel<br>&nbsp; &nbsp;echo \"%wheel ALL=(ALL) ALL\" &gt; \/etc\/sudoers.d\/wheel<br>}<\/p><p># SSH yap\u0131land\u0131rmas\u0131<br>configure_ssh() {<br>&nbsp; &nbsp;print_message \"SSH yap\u0131land\u0131r\u0131l\u0131yor...\"<br>&nbsp; &nbsp;rc-update add sshd default<br>&nbsp; &nbsp;service sshd start<br>&nbsp; &nbsp;<br>&nbsp; &nbsp;# SSH g\u00fcvenlik ayarlar\u0131<br>&nbsp; &nbsp;sed -i 's\/#PermitRootLogin.*\/PermitRootLogin no\/' \/etc\/ssh\/sshd_config<br>&nbsp; &nbsp;sed -i 's\/#PasswordAuthentication.*\/PasswordAuthentication yes\/' \/etc\/ssh\/sshd_config<br>&nbsp; &nbsp;<br>&nbsp; &nbsp;rc-service sshd restart<br>}<\/p><p># Saat dilimi ayar\u0131<br>configure_timezone() {<br>&nbsp; &nbsp;print_message \"Saat dilimi ayarlan\u0131yor...\"<br>&nbsp; &nbsp;setup-timezone Europe\/Istanbul<br>}<\/p><p># Sistem ara\u00e7lar\u0131 yap\u0131land\u0131rmas\u0131<br>configure_system_tools() {<br>&nbsp; &nbsp;print_message \"Sistem ara\u00e7lar\u0131 yap\u0131land\u0131r\u0131l\u0131yor...\"<br>&nbsp; &nbsp;<br>&nbsp; &nbsp;# Bash'i varsay\u0131lan shell yap<br>&nbsp; &nbsp;sed -i 's\/\\\/bin\\\/ash\/\\\/bin\\\/bash\/g' \/etc\/passwd<br>&nbsp; &nbsp;<br>&nbsp; &nbsp;# Vim yap\u0131land\u0131rmas\u0131<br>&nbsp; &nbsp;cat &gt; \/etc\/vim\/vimrc.local &lt;&lt; EOF<br>syntax on<br>set number<br>set showmatch<br>set ignorecase<br>set smartcase<br>set incsearch<br>set ruler<br>EOF<br>}<\/p><p># Ana fonksiyon<br>main() {<br>&nbsp; &nbsp;print_message \"Alpine Linux yap\u0131land\u0131rmas\u0131 ba\u015fl\u0131yor...\"<br>&nbsp; &nbsp;<br>&nbsp; &nbsp;update_system<br>&nbsp; &nbsp;install_base_packages<br>&nbsp; &nbsp;create_user<br>&nbsp; &nbsp;configure_ssh<br>&nbsp; &nbsp;configure_timezone<br>&nbsp; &nbsp;configure_system_tools<br>&nbsp; &nbsp;<br>&nbsp; &nbsp;print_message \"Yap\u0131land\u0131rma tamamland\u0131!\"<br>&nbsp; &nbsp;print_warning \"Sistemi yeniden ba\u015flatman\u0131z \u00f6nerilir.\"<br>}<\/p><p># Beti\u011fi \u00e7al\u0131\u015ft\u0131r<br>main<\/p><p>```<\/p><p>Bu betik \u015funlar\u0131 yapar:<\/p><p>1. Sistem g\u00fcncellemesi<br>2. Temel paketlerin kurulumu<br>3. Yeni kullan\u0131c\u0131 olu\u015fturma<br>4. SSH yap\u0131land\u0131rmas\u0131<br>5. Saat dilimi ayar\u0131<br>6. Temel sistem ara\u00e7lar\u0131n\u0131n yap\u0131land\u0131rmas\u0131<\/p><p>Kullanmak i\u00e7in:<br>1. Beti\u011fi bir dosyaya kaydedin (\u00f6rn: `alpine-setup.sh`)<br>2. \u00c7al\u0131\u015ft\u0131rma izni verin: `chmod +x alpine-setup.sh`<br>3. Root olarak \u00e7al\u0131\u015ft\u0131r\u0131n: `.\/alpine-setup.sh`<\/p><p>Betik etkile\u015fimli olarak \u00e7al\u0131\u015f\u0131r ve gerekli bilgileri sorar. G\u00fcvenlik ayarlar\u0131n\u0131 ve temel yap\u0131land\u0131rmalar\u0131 otomatik olarak yapar.<\/p><p>&nbsp;<\/p><blockquote><p><br>==&gt; Alpine Linux yap\u0131land\u0131rmas\u0131 ba\u015fl\u0131yor...<br>==&gt; Sistem g\u00fcncelleniyor...<br>fetch http:\/\/dl-cdn.alpinelinux.org\/alpine\/v3.19\/main\/x86_64\/APKINDEX.tar.gz<br>fetch http:\/\/dl-cdn.alpinelinux.org\/alpine\/v3.19\/community\/x86_64\/APKINDEX.tar.gz<br>v3.19.7-23-g6f54aca1199 <br>v3.19.7-23-g6f54aca1199 <br>OK: 23119 distinct packages available<br>OK: 181 MiB in 86 packages<br>==&gt; Temel paketler kuruluyor...<br>(1\/28) Installing iputils-arping (20221126-r2)<br>(2\/28) Installing iputils-clockdiff (20221126-r2)<br>(3\/28) Installing iputils-ping (20221126-r2)<br>(4\/28) Installing iputils-tracepath (20221126-r2)<br>(5\/28) Installing iputils (20221126-r2)<br>(6\/28) Installing libmount (2.39.3-r0)<br>(7\/28) Installing libsmartcols (2.39.3-r0)<br>(8\/28) Installing lsblk (2.39.3-r0)<br>(9\/28) Installing nano (7.2-r1)<br>(10\/28) Installing mii-tool (2.10-r3)<br>(11\/28) Installing net-tools (2.10-r3)<br>(12\/28) Installing hwdata-pci (0.377.2-r0)<br>(13\/28) Installing pciutils-libs (3.10.0-r0)<br>(14\/28) Installing pciutils (3.10.0-r0)<br>(15\/28) Installing libevent (2.1.12-r7)<br>(16\/28) Installing tmux (3.3a_git20230428-r0)<br>(17\/28) Installing tree (2.1.1-r0)<br>(18\/28) Installing hwdata-usb (0.377.2-r0)<br>(19\/28) Installing udev-init-scripts (35-r1)<br>(20\/28) Installing udev-init-scripts-openrc (35-r1)<br>(21\/28) Installing eudev-libs (3.2.14-r1)<br>(22\/28) Installing eudev (3.2.14-r1)<br>(23\/28) Installing eudev-openrc (3.2.14-r1)<br>(24\/28) Installing pkgconf (2.1.0-r0)<br>(25\/28) Installing eudev-dev (3.2.14-r1)<br>(26\/28) Installing libusb (1.0.26-r3)<br>(27\/28) Installing libusb-dev (1.0.26-r3)<br>(28\/28) Installing usbutils (017-r0)<br>Executing busybox-1.37.0-r12.trigger<br>Executing eudev-3.2.14-r1.trigger<br>OK: 188 MiB in 114 packages<br>==&gt; Yeni kullan\u0131c\u0131 olu\u015fturuluyor...<br>Kullan\u0131c\u0131 ad\u0131: onder<br>Changing password for onder<br>New password:<br>Retype password:<br>passwd: password for boot changed by root<br>==&gt; SSH yap\u0131land\u0131r\u0131l\u0131yor...<br>* rc-update: sshd already installed in runlevel `default'; skipping<br>* WARNING: sshd has already been started<br>* Caching service dependencies ... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>* Stopping sshd ... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>* Starting sshd ... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>==&gt; Saat dilimi ayarlan\u0131yor...<br>==&gt; Sistem ara\u00e7lar\u0131 yap\u0131land\u0131r\u0131l\u0131yor...<br>==&gt; Yap\u0131land\u0131rma tamamland\u0131!<br>==&gt; Sistemi yeniden ba\u015flatman\u0131z \u00f6nerilir.<br>&nbsp;<\/p><\/blockquote><p>&nbsp;<\/p>","excerpt":"Alpine Linux kurulumundan sonra temel kurulumlar\u0131 otomatik yapmak i\u00e7in a\u015fa\u011f\u0131daki bash scripti kullanabilirsiniz","created_at":"2025-02-23 20:16:53","updated_at":"2026-09-08 00:57:00","category_id":10,"view_count":725,"reading_time":6,"status":"published","editor_choice":0,"is_editor_choice":0,"published_at":"2025-02-23 20:16:53","featured_image":"resimyok.jpg","slug":"alpine-linux-kurulumundan-sonrasi","category_name":"nix Linux Unix","category_slug":"nix-linux-unix"}