LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-31-2011, 02:17 PM   #1
rischfre
LQ Newbie
 
Registered: Aug 2011
Posts: 1

Rep: Reputation: Disabled
Linux server cannot identify new connexions


Hi

I m running a Centos 5.6 server, with several basic applications (mySQL, Web, ...).
Sometimes, the server craches, and does not let me connect to it.
SSH, Telnet, even on the own server.
For each process (Telnet, SSH...) it does not let me further than the LOGIN. That means ports are open, services are running, but something strange is ocuring when try to identify the user.
Could you please let me know what should i do?
thank you
 
Old 08-31-2011, 03:50 PM   #2
timur91
Member
 
Registered: Aug 2011
Posts: 42

Rep: Reputation: Disabled
most likely someone is abusing some script on your server. Try the following script to run each minute as cronjob:
Code:
* * * * * /path/to/script.sh
and the script...
Code:
#!/bin/sh

mkdir -p /var/log/script
date=`date +%H_%M`

/etc/init.d/httpd fullstatus > /var/log/script/apache_status_$date
top -b -n 1 > /var/log/script/top_$date
netstat -anp > /var/log/script/netstat_$date
ps -efww > /var/log/script/ps_$date
free > /var/log/script/free_$date
w > /var/log/script/w_$date
You will need to enable ExtendedStatus and mod_status in apache with the /server-status location so you can get each minute's apache status.

After the server is dead and back online you will have a lot of info to look at. Check the active connections, processes, pids, compare with the apache status, etc

java socket

Last edited by timur91; 01-05-2012 at 05:35 AM.
 
Old 08-31-2011, 08:13 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Logging that info isn't a bad idea, but doing it via cron means every minute its going to create a new env to run that stuff; bit of a performance hit; consider making it a daemon instead.
Its worth checking the normal logfiles like /var/log/messages etc. There may be some clues in there.
Also, it doesn't necessarily follow that you're being attacked, you need to check first, but when it crashes, it may corrupt the passwd or shadow file, so that could prevent successful logins.
 
Old 09-01-2011, 05:32 PM   #4
timur91
Member
 
Registered: Aug 2011
Posts: 42

Rep: Reputation: Disabled
/var/log/messages provides no info at all

running that cron each minute until the problem is solved won't hurt at all

java socket

Last edited by timur91; 01-05-2012 at 05:35 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to identify a hacked server. masenko703 Linux - Security 3 05-22-2009 04:36 AM
how to identify dhcp server ? bjh DamnSmallLinux 2 10-24-2008 04:37 PM
Can a ssh server NOT identify itself? drokmed Linux - Security 10 02-15-2008 07:34 AM
LXer: Print deal makes connexions leading open-source publisher LXer Syndicated Linux News 0 07-14-2006 02:21 AM
AOL Connexions problem with SUSE 9.1 Pro rado_london Linux - Software 5 07-23-2005 05:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration