Skip to main content

Mengetahui proses ID from port yang di buka

--base--

Untuk mengetahui suatu proses yang sedang berjalan, dalam linux kita bisa mengetahuinya dengan command "ps". Akan tetapi bagaimana jika kita ingin mematikan suatu proses tetapi kita hanya tahu port yang di buka oleh port tersebut.
Berikut singkatnya

--1--
Sebagai contoh dengan nmap kita melihat data sebagai berikut
[root@database1 bin]# nmap localhost

Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2010-07-22 14:50 WIT
Interesting ports on database1 (127.0.0.1):
(The 1642 ports scanned but not shown below are in state: closed)
PORT     STATE SERVICE
22/tcp   open  ssh
25/tcp   open  smtp
111/tcp  open  rpcbind
631/tcp  open  ipp
3306/tcp open  mysql
8009/tcp open  ajp13
8080/tcp open  http-proxy
8082/tcp open  blackice-alerts

--2--
misal kita ingin mematikan proses untuk port 8082
[root@database1 bin]# lsof -w -n -i tcp:8082
COMMAND   PID USER   FD   TYPE DEVICE SIZE NODE NAME
java    20131 root   75u  IPv6 769223       TCP *:8082 (LISTEN)

--selanjut nya--
terserah anda bisa di kill ato di liatin doang
:D


--ceck n jajal --

[root@database1 bin]# kill -9 20131

[root@database1 bin]# nmap localhost

Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2010-07-22 14:50 WIT
Interesting ports on database1 (127.0.0.1):
(The 1643 ports scanned but not shown below are in state: closed)
PORT     STATE SERVICE
22/tcp   open  ssh
25/tcp   open  smtp
111/tcp  open  rpcbind
631/tcp  open  ipp
3306/tcp open  mysql
8009/tcp open  ajp13
8080/tcp open  http-proxy

Nmap run completed -- 1 IP address (1 host up) scanned in 0.214 seconds

Comments

  1. maap kk.. cmn mo nambahin aj...
    kek na ribet dah, klo pake lsof.. kelamaan opsi na :D... bukannya netstat -ntlp atau -ntap dah ketahuan pid nya ? tinggal kill atau killall atuh :D

    itu pun klo d linux, d freebsd kek na dah beda.. dl pernah pake tcpkill skrg dah lp :D

    thanks buat lsof -w -n na .. tmbah referensi :cendolbig:

    ReplyDelete
  2. :D liat sikon n kebiasaan aja kek nya. but thank's 4 comment

    ReplyDelete

Post a Comment

comment please ...

Popular posts from this blog

Webalizer - Statistik trafik/kunjungan web (ubuntu)

--goal--
make subdomain trafik statistik

--install--
run this command :
sudo apt-get install webalizeredit "/etc/apache2/apache2.conf" , set
HostnameLookups Off into :
HostnameLookups On
--1--
All we need is already prepared, now set log of vhost in "/etc/apache2/sites-enabled" to spesifict folder.
exp. $sudo vi /etc/apache2/sites-enabled/monitor CustomLog ${APACHE_LOG_DIR}/access.log into: CustomLog ${APACHE_LOG_DIR}/vhost/monitor/access.logrestart service
$sudo /etc/init.d/apache2 restart
--2--
create another file config of webalizer in /etc/webalizer
exp. vi /etc/webalier/monitor.conf
set the LogFile to apache2 logfile:
LogFile /var/log/apache2/vhost/monitor/access.log # apache log OutputDir /var/webalizer/monitor/ #webalizer report Incremental yes ReportTitle Usage statistics for HostName monitor.brekele.co.cc
--3--
create script to run webalizer via crontab
exp. vi /etc/webalizer/cron_job
#!/bin/bash echo "di jalankan pada: `date +"%d-%B-%Y %r"…

pgpoolAdmin, web interface for pgpool

--preparation--
next capter of pgpool from my last post ( here), now i wanna post about a tool that can manage pgpool from web interface called pgpoolAdmin. next... enjoy the post... ^_^

--1--
first we need to download pgpooladmin from here, extrak and copy or move to http directory( for exp : /var/www) 
$wget http://pgfoundry.org/frs/download.php/2964/pgpoolAdmin-3.0.3.tar.gz $tar zxvf pgpoolAdmin-3.0.3.tar.gz $sudo cp -Rf pgpoolAdmin-3.0.3 /var/www/test
 --2--
install pgpooladmin via web on: http://localhost/test/install


make sure owner of that file is "www-data"(of course have write akses) and check again



login with user that you create on /etc/pcp.conf (for more detail see my last post



and done.ya.. tooo.......!!!
 ^_^

send oracle 11g audit log to syslog server ( on other PC)

--preparation-- 
well...... this time i will write about syslog, and for this experiment what we need is :
- kiwi syslog server get from here and install it on your PC( i use xp for this server syslog)
- oracle db
- and of course, a cup of coffee is a must and other thing that make you relax and comfortable ( :p )

--scema--
first thing to do is redirect oracle audit log to syslog, and than from syslog send to syslog server( kiwi syslog)

--1--
 edit initSID.ora and add this folowing config :
create "/var/log/oracle/" firs
audit_file_dest='/var/log/oracle/' audit_trail='OS' AUDIT_SYSLOG_LEVEL=local1.warning after that edit /etc/syslog.conf, and add this folowing config :
#Save oracle rdbms audit trail to oracle_audit.log local1.warning /var/log/oracle/oracle_audit.log #Send oracle rdbms audit trail to remote syslog server local1.warning @1.1.1.1 #<= ip your syslog server--2--
restart syslog service with command :
/sbin/service syslog restart …