From owner-freebsd-questions@FreeBSD.ORG Fri Jan 12 22:39:38 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB31916A4FE for ; Fri, 12 Jan 2007 22:39:38 +0000 (UTC) (envelope-from maanjee@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.240]) by mx1.freebsd.org (Postfix) with ESMTP id 42F9513C441 for ; Fri, 12 Jan 2007 22:39:37 +0000 (UTC) (envelope-from maanjee@gmail.com) Received: by an-out-0708.google.com with SMTP id c24so611519ana for ; Fri, 12 Jan 2007 14:39:37 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=SUUIn8fUumz6J37GNxfFyQofi/3J7qgszVmgT5ep3oTbNjSrLWP1zLu0ITQ6t63kjxpgwqBVlRoGGJUQiX2DqzgeOM35IPatACPkYlLa6sxsv2TwB3hAbjHJw57xSPjv6ZHGHzS5GbCeCzoD2IDxVTBs+YNaNU3FPMtJpjJdUto= Received: by 10.100.37.4 with SMTP id k4mr701046ank.1168641577061; Fri, 12 Jan 2007 14:39:37 -0800 (PST) Received: by 10.100.33.13 with HTTP; Fri, 12 Jan 2007 14:39:36 -0800 (PST) Message-ID: <2cd0a0da0701121439m3660773eh96352826a3cb01b8@mail.gmail.com> Date: Fri, 12 Jan 2007 23:39:36 +0100 From: VeeJay To: "Reko Turja" In-Reply-To: <2cd0a0da0701121425r2db393b0n8f21289c0bd48970@mail.gmail.com> MIME-Version: 1.0 References: <2cd0a0da0701121343g7fa2535fv4a7b201f5a03aff2@mail.gmail.com> <01f401c73694$417d7830$0a0aa8c0@rivendell> <2cd0a0da0701121425r2db393b0n8f21289c0bd48970@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD-Questions Subject: Re: Please Help! How to STOP them... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jan 2007 22:39:39 -0000 What should be ENABLED and what should be DISABLED? # $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $ # $FreeBSD: src/crypto/openssh/sshd_config,v 1.42.2.4 2006/11/11 00:51:28 des Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin # The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options change a # default value. # Note that some of FreeBSD's defaults differ from OpenBSD's, and # FreeBSD has a few additional options. #VersionAddendum FreeBSD-20061110 #Port 22 #Protocol 2 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: # HostKey for protocol version 1 #HostKey /etc/ssh/ssh_host_key # HostKeys for protocol version 2 #HostKey /etc/ssh/ssh_host_dsa_key # Lifetime and size of ephemeral version 1 server key #KeyRegenerationInterval 1h #ServerKeyBits 768 # Logging # obsoletes QuietMode and FascistLogging #SyslogFacility AUTH #LogLevel INFO # Authentication: #LoginGraceTime 2m #PermitRootLogin no #StrictModes yes #MaxAuthTries 6 #RSAAuthentication yes #PubkeyAuthentication yes #AuthorizedKeysFile .ssh/authorized_keys # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #RhostsRSAAuthentication no # similar for protocol version 2 #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # RhostsRSAAuthentication and HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes # Change to yes to enable built-in password authentication. #PasswordAuthentication no #PermitEmptyPasswords no # Change to no to disable PAM authentication #ChallengeResponseAuthentication yes # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes # Set this to 'no' to disable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. #UsePAM yes #AllowTcpForwarding yes #GatewayPorts no #X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yes #UseLogin no #UsePrivilegeSeparation yes #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 #UseDNS yes #PidFile /var/run/sshd.pid #MaxStartups 10 #PermitTunnel no # no default banner path #Banner /some/path # override default of no subsystems Subsystem sftp /usr/libexec/sftp-server # Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # ForceCommand cvs server What steps need to follow? On 1/12/07, VeeJay wrote: > > Thanks Reko.... > > Just couple of more questions... > > > On 1/12/07, Reko Turja wrote: > > > > From: "VeeJay" > > To: < maanjee@gmail.com>; "FreeBSD-Questions" > > > > Sent: Friday, January 12, 2007 11:43 PM > > Subject: Please Help! How to STOP them... > > > > > > >I am reading many hundred lines similar to below mentioned? > > > > > > Could you please advise me what to do and how can I make my box more > > > secure? > > > > > > Jan 9 17:54:42 localhost sshd[5130]: reverse mapping checking > > > getaddrinfo > > > for bbs-83-179.189.218.on-nets.com [218.189.179.83] failed - > > > POSSIBLE > > > BREAK-IN ATTEMPT! > > > Jan 9 17:54:42 localhost sshd[5130]: Invalid user sysadmin from > > > 218.189.179.83 > > > > It's basically just script kiddies trying to get in using some ready > > made user/password pairs. > > > > Lots of info covering this has been posted in these newsgroups > > previously, but some things you might consider > > > > Moving your sshd port somewhere else than 22 - the prepackaged > > "cracking" programs don't scan ports, just blindly try out the default > > port - with determined/skilled attacker it's different matter entirely > > though. > > > How to change the port from 22 to something other and in what range should > I choose a number? > > > Use some kind of portblocker (lots in ports tree) which closes the > > port after predetermined number of attempts - or as an alternative, > > use PF to close the port for IP's in question after predetermined > > number of connection attempts in given time. > > > Can you suggest such port which I should install to block these attempts? > > Use key based authentication and stop using passwords altogether. > > > What do you mean here? > > Remember to keep ssh1 disabled as well as direct root access into ssh > > from the ssh config file. > > > How to disable SSH1 and How to stop direct root access into ssh, where to > change? > > -Reko > > > > > > > -- > Thanks! > > BR / vj -- Thanks! BR / vj