Friday 28 December 2018

Simpan iptables debian 9 ! permanent?

Assalamualaikum wr.wb

Pada postingan kali ini kita akan membahas tentang debian 9, dimana bila kita konfig secara keseluruhan kedalam server.
Nah selama saya mempelajari beberapa minggu dalam setting debian 9 ini memiliki beberapa perubahan terutama dalam level konfigurasi jaringan. Kalau kalian terbiasa konfig dengan metode cli mungkin sec default letak konfig pemberian ip secara static tidak masalah kalau dalam debian 9.

Tapi kalian jangan harap menemukan konfig ip address berada di rc.local ^_^

Nah pertanyaannya dimana sekarang?

setelah saya beberapa mencari konfig dan pengaturan rc local memang ada kendala di debian sembilan ini

rupa-rupanya kita membutuhkan aplikasi tambahan dari pihak debian yaitu

iptables-presistent < namanya

nah adapun cara installasinya dengan cara
# apt-get install iptables-presistent

nah aplikasi tersebut berada di dvd2 iso debian 9

ketika kita install aplikasi tersebut nanti hasil installasinya si debian 9 ini akan membuat sebuah folder dengan nama iptables dan akan membuat 2 buah file dengan nama rules.v4 dan rules.v6

jadi untuk menambahkan konfig iptables langsung saja di luar folder
sbg contoh:
# iptables -t nat -A POSTROUTING -j MASQUERADE (jadi tidak lagi di dalam rc.local)
nah setelah menambahkan skrip tersebut ketika si debian restart maka iptables yang tadi kita tambahkan tidak akan bekerja karena tidak tersimpan
adapun cara menyimpannya adalah dengan cara:
# iptables-save> /etc/iptables/rules.v4

nah bila sudah sekarang kalian bisa coba restart debiannya apakan iptables yang kita tambahkan tadi tersimpan atau tidak

Langkah ini sudah saya terapkan dan berhasil

selamat mencoba

akhir kata wassalam

sumber : https://www.thomas-krenn.com/en/wiki/Saving_Iptables_Firewall_Rules_Permanently

Tuesday 18 December 2018

Cara konfig password MariaDB dan setting phpmyadnin

Assalamualaikum

Kali ini saya akan memposting bagaimana cara untuk kalian yang baru seperti saya menggunakan mariadb sebagai database server, untuk pembelajaran dilinux server, karena sekarang untuk materi pembelajaran konfigurasi server database terutama yang masih menggunakan debian 8 mungkin tidak masalah karena masih menggunakan mysql versi lama tapi kalau sudah update ke debian versi terbaru terutama debian 9 maka sudah akan lain ceritanya terutama pada bagian konfigurasi mariadb

oke langsung saja:

1. Anggap saja kalian sudah selesai konfigurasi ip dan berhasil terhubung ke client dan sudah berhasil installasi
- mysql-server
- apache2
- dan phpmyadmin
maka kalau kalian buka di browser maka kita ketikan http://localhost/phpmyadmin maka akan tampil seperti berikut


apabila kalian login tidak akan berhasil karena secara default mariadb tidak sinkron dengan phpmyadmin dan secara default pula mariadb tidak menggunakan password.

2. Untuk konfigurasi mariadb kita perlu memberikan akses root dan password pada mariadb yaitu dengan cara (maaf males ketik jadi pakai punya orang inggris)

Step 1 — Identifying the Database Version

Most modern Linux distributions ship with either MySQL or MariaDB,
a popular drop-in replacement which is fully compatible with MySQL.
Depending on the database used and its version, you'll need to use different
commands to recover the root password.
You can check your version with the following command:
  • mysql --version
You'll see some output like this with MySQL:
MySQL output
mysql Ver 14.14 Distrib 5.7.16, for Linux (x86_64) using EditLine wrapper
Or output like this for MariaDB:
MariaDB output
mysql Ver 15.1 Distrib 5.5.52-MariaDB, for Linux (x86_64) using readline 5.1
Make note of which database and which version you're running, as you'll use them later. Next, you need to stop the database so you can access it manually.

Step 2 — Stopping the Database Server

To change the root password, you have to shut down the database server beforehand.
You can do that for MySQL with:
  • sudo systemctl stop mysql
And for MariaDB wtih:
  • sudo systemctl stop mariadb
After the database server is stopped, you'll access it manually to reset the root password.

Step 3 — Restarting the Database Server Without Permission Checking

If you run MySQL and MariaDB without loading information about user privileges, it will allow you to access the database command line with root privileges without providing a password. This will allow you to gain access to the database without knowing it.
To do this, you need to stop the database from loading the grant tables, which store user privilege information. Because this is a bit of a security risk, you should also skip networking as well to prevent other clients from connecting.
Start the database without loading the grant tables or enabling networking:
  • sudo mysqld_safe --skip-grant-tables --skip-networking &
The ampersand at the end of this command will make this process run in the background so you can continue to use your terminal.
Now you can connect to the database as the root user, which should not ask for a password.
  • mysql -u root
You'll immediately see a database shell prompt instead.
MySQL prompt
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
MariaDB prompt
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
Now that you have root access, you can change the root password.

Step 4 — Changing the Root Password

One simple way to change the root password for modern versions of MySQL is using the ALTER USERcommand. However, this command won't work right now because the grant tables aren't loaded.
Let's tell the database server to reload the grant tables by issuing the FLUSH PRIVILEGES command.
  • FLUSH PRIVILEGES;
Now we can actually change the root password.
For MySQL 5.7.6 and newer as well as MariaDB 10.1.20 and newer, use the following command.
  • ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
For MySQL 5.7.5 and older as well as MariaDB 10.1.20 and older, use:
  • SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password');
Make sure to replace new_password with your new password of choice.
Note: If the ALTER USER command doesn't work, it's usually indicative of a bigger problem. However, you can try UPDATE ... SET to reset the root password instead.
  • UPDATE mysql.user SET authentication_string = PASSWORD('new_password') WHERE User = 'root' AND Host = 'localhost';
Remember to reload the grant tables after this.
In either case, you should see confirmation that the command has been successfully executed.
Output
Query OK, 0 rows affected (0.00 sec)
The password has been changed, so you can now stop the manual instance of the database server and restart it as it was before.

Step 5 — Restart the Database Server Normally

First, stop the instance of the database server that you started manually in Step 3. This command searches for the PID, or process ID, of MySQL or MariaDB process and sends SIGTERM to tell it to exit smoothly after performing clean-up operations. You can learn more in this Linux process management tutorial.
For MySQL, use:
  • sudo kill `cat /var/run/mysqld/mysqld.pid`
For MariaDB, use:
  • sudo kill `/var/run/mariadb/mariadb.pid`
Then, restart the service using systemctl.
For MySQL, use:
  • sudo systemctl start mysql
For MariaDB, use:
  • sudo systemctl start mariadb
Now you can confirm that the new password has been applied correctly by running:
  • mysql -u root -p

The command should now prompt for the newly assigned password. Enter it, and you should gain access to the database prompt as expected.

======================================================================

ok sampai disini belum selesai
selanjutnya adalah mengkonfigurasi phpmyadmin agar dapat terkoneksi dengan mariadb yaitu dengan cara menjalankan ulang konfigurasi installasi phpmyadmin yaitu dengan cara :
# sudo dpkg-reconfigure phpmyadmin
<Ok>
Reinstall database for phpmyadmin: <Yes>
Connection method for MySQL database server for phpmyadmin: TCP/IP
Host name of the MySQL database server for phpmyadmin: localhost
Port number for the MySQL service: 3306
MySQL database name for phpmyadmin: phpmyadmin
<Ok>
MySQL username for phpmyadmin: root
MySQL application password for phpmyadmin: pass # OR ANY PASSWORD YOU WANT
Password confirmation: pass
Name of the database's administrative user: root
Web server to reconfigure automatically: apache2
An error occurred while installing the database: ignore
Now if you try connect into phpmyadmin (localhost/phpmyadmin) using
username: root
password: pass

nah kalau sudah silahkan restart semua service yang berkaitan dengan mysql dan phpmyadmin agar lebih afdol restart pc servernya

dan jika berhasil nanti akan tampil dan masuk database sebagai user root seperti gambar berikut:

nah itu kita sudah masuk ke dalam database mariadb dengan menggunakan phpmyadmin.

oke mungkin itu saja yang bisa saya buat dalam postingan ini semoga bisa bermanfaat kepada rekan semua jika ingin ada yang ditanya silahkan berkomentar di kolom komentar

sekian dari saya terima kasih





Thursday 19 July 2018

Zeroshell-Perfect and simple Router


Zeroshell adalah distribusi Linux untuk server dan perangkat embedded yang ditujukan untuk menyediakan layanan jaringan utama yang diperlukan oleh LAN. Ini tersedia dalam bentuk Live CD atau Compact Flash image dan Anda dapat mengkonfigurasi dan mengaturnya menggunakan browser web Anda.

Ini mencakup banyak fitur jenis perusahaan, termasuk dukungan LAN virtual (VLAN), server RADIUS untuk 802.1X, server / klien VPN, portal tawanan, filter virus berbasis proxy, dan dukungan UMTS / HSDPA menggunakan modem 3G. Ia juga menawarkan load balancing dan failover dari beberapa koneksi Internet. Ini memiliki mode titik akses nirkabel yang bekerja dengan adaptor nirkabel berbasis Atheros dan mendukung beberapa SSID dan VLAN. Anda dapat mengkonfigurasi pengaturan melalui panel kontrol berbasis Web.

Saturday 14 July 2018

Instalasi dan Setting Password Root Mysql Server Debian 9 Stretch MariaDB

Assalamualaikum wr.wb

Mungkin secara default antara debian 8 pada waktu menginstallasi mysql-server sudah ada konfirmasi untuk langsung mengisikan password mysql, tapi jika anda menggunakan debian 9 maka sudah lain ceritanya.

untuk anda yang belum bisa beradaptasi dengan konfigurasi dan installasi debian 9 maka disini saya coba sedikit membantu anda semoga dapat bermanfaat

oke untuk pelaksanaanya langsung saja apabila anda sudah menginstallasi mysql-servernya kita langsung saja konfigurasi langsung dengan cara berikut ini

2. Login Mysql-server
Setelah instalasi selesai, kita sudah bisa masuk ke mysql-server kita, dengan cara
mysql -h localhost -u root -p
Untuk password defaultnya, langsung anda tekan [ENTER] saja , alias tidak memerlukkan password



1. Ketik mysql_secure_installations Pada Server
mysql_secure_installations
Seperti gambar di bawah.

Enter current password, langsung enter saja

Set root password, pilih yes. Lalu masukkan password yang anda inginkan, lalu enter, lalu
Remove enonymous ? No
Disallow root login remotely, jika anda ingin host  login dengan user root pilih no, jika tidak yes
Remove test database and access to it ? No
Reloa privilege tables now ? YES

2. Login mysql-server
mysql -u root 
Pada langkah ini, mysql masih belum meminta kita untuk memasukkan password. setelah login pada mysql, ketikkan perintah seperti berikut.
[mysql] use mysql;
[mysql] update user set plugin=' ' where user='root';
[mysql] flush privileges;
[mysql] exit
Dengan begitu, saat akan login mysql-server kita akan diminta untuk memasukkan password
contoh, jika kita tidak memasukkan password


Oke mungkin itu saja cara setting password mariaDB pada debian 9 semoga bermanfaat

Cara membuat dock ubuntu dapat di minimize dan maximaze

 Assalamualaikum wr.wb salam para pecinta opensource ubuntu, oke kali ini mau bagi tutorial yang mungkin para pecinta ubuntu yang belum mene...