<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="generator" content="Osso Notes">
    <title></title></head>
<body>
<p>&gt; On Sat, 2010-08-28 at 01:22 +0100, Daniel Case wrote:
<br>&gt; &gt; Hi there,
<br>&gt; &gt; 
<br>&gt; &gt; One of my servers has recently been attacked, it has one remote SSH
<br>&gt; &gt; user which cannot run 'sudo', i made it like that so that if it was
<br>&gt; &gt; comprimized, no-one would be able to do much.
<br>&gt; &gt; 
<br>&gt; &gt; However, someone managed to gain the password to that account on the
<br>&gt; &gt; server then used "vi /etc/passwd" to gain a list of users, then
<br>&gt; &gt; launched a bruteforce using su against my admin account.
<br>&gt; &gt; (that's what I can gather from the logs)
<br>&gt; &gt; 
<br>&gt; &gt; This did not get very far before I saw and kicked the user off and
<br>&gt; &gt; changed all of the passwords, but I would like to know how to prevent
<br>&gt; &gt; this sort of thing happening again.
<br>&gt; &gt; 
<br>&gt; &gt; I need to know mainly how to stop the SSH user running su in the first
<br>&gt; &gt; place and how to stop the user seeing files like /etc/passwd
<br>&gt; &gt; 
<br>&gt; &gt; Anyone have any suggestions?
<br>&gt; 
<br>&gt; Denyhosts is quite useful in stopping brute force attacks. After so many
<br>&gt; failed attempts it just blocks the attacking IP.
<br>&gt; 
<br>&gt; -Matt Daubney
<br>&lt;snip&gt;
<br>Also consider using fail2ban. You could also configure your server to not permit root logins in the /etc/ssh/sshd_config
<br>
<br>Also start using key based authentication and do not permit password based logins (if this is possible for your situation!)
<br>
<br>Hope this helps.
<br>
<br>P <br></p>
</body>
</html>