Test Block Top

The Blog...
Articles, Tips & Trick and Other Interesting Information...
Tampilkan postingan dengan label SSH. Tampilkan semua postingan
Tampilkan postingan dengan label SSH. Tampilkan semua postingan
17 Maret 2012

"Securing SSH" Ganti Port Default SSH

Semakin berkembangnya model hacking serangan acak (Inggris: Brute Force Attacks), saat ini sangat disarankan administrator server untuk mengganti port default SSH "Port 22" ke angka yang lebih tinggi/rumit. Langkah ini merupakan salah satu bentuk pencegahan dari model hacking brute force attacks.

Ilustrasi artikel ini menggunakan CenOS Versi 5.8 (Final), namun tahapan proses dalam mengganti port default ssh tidak akan terlalu jauh berbeda dengan distro lainnya.

Pertama; update file "/etc/ssh/sshd_config", ganti "Port 22" dengan nilai yang lebih tinggi, misal: "Port 9157".

Kedua; Edit file "/etc/services" dan ganti nomor port default (22) ke nomor port yang baru (misal seperti di atas "9157")

[bash collapse="false"]
ssh 9157/tcp # SSH Remote Login Protocol
ssh 9157/udp # SSH Remote Login Protocol
[/bash]

Restart service ssh:

[bash collapse="false"]
[root@localhost ~]# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
[root@localhost ~]#
[/bash]

Selesai. Sekarang setiap kali login ke ssh atau login service terkait lainnya, anda harus menggunakan port ssh yang baru. Dan juga jika server yang anda gunakan memakai firewall, anda harus approve port baru sesuai perubahan setting port yang anda lakukan.

Referensi:

  1. http://wiki.centos.org/HowTos/Network/SecuringSSH

09 Februari 2012

Website Tidak Bisa Dibuka Meskipun Modul mod_rewrite On

Beberapa hari yang lalu saya coba installkan blog wordpress teman pada vps. Setting permalink saya set ke "Custom Structure → /%category%/%postname%/", file .htaccess baru sudah otomatis tersetup namun ketika test buka halaman posting website error (Not Found).

Berikut Solusinya:

Cek dulu apakah modul mod_rewrite sudah aktif pada webserver apache, login ssh & ketikkan command:

apachectl -M

[bash highlight="6"]
[root@victor ~]# apachectl -M
Loaded Modules:
...
...
alias_module (shared)
rewrite_module (shared)
...
...
cgi_module (shared)
version_module (shared)
...
...
python_module (shared)
ssl_module (shared)
Syntax OK
[/bash]

Jika modul rewrite sudah aktif (rewrite_module (shared))baris ke-6 pada code di atas, kemungkinan AllowOverride pada file konfigurasi apache (httpd.conf) masih di set ke "None" (AllowOverride None).

Edit value "AllowOverride None" ke "AllowOverride All" pada file httpd.conf (/etc/httpd/conf/httpd.conf) untuk semua dokumen root direktori (biasanya "/var/www/html") → lihat baris ke-17 pada code di bawah.

[apache highlight="17"]
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
[/apache]

Restart apache daemon:

[bash collapse="false"]
[root@victor ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@victor ~]#
[/bash]

Selesai, refresh halaman yang tadinya tidak bisa di buka (Not Found).
Loncat ke Atas ↑