IT NEWS     Energy      iTWire Technology Feature - Virtualisation
Technology news and Jobs arrow Information Technology News arrow Hack and crack proof SSH on Linux
Hack and crack proof SSH on Linux PDF E-mail
User Rating: / 15
PoorBest 
by David M Williams   
Friday, 03 August 2007
It’s inevitable: if your computer is Internet-connected you will have people coming a-knockin’. Fortunately Linux users are more savvy than to think any keep-alive ping or other piece of Internet flotsam is a hack attempt. Even so, it’s simply a matter of time before your router’s lights flash heavily and /var/log/auth.log (/var/log/secure on RedHat) fills with chilling messages like these:
$ tail /var/log/auth.log
Aug  1 20:23:41 zugzug sshd[15577]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.218.125.178
Aug  1 20:23:44 zugzug sshd[15577]: Failed password for invalid user edward from 210.48.230.5 port 43812 ssh2
Aug  1 20:23:46 zugzug sshd[15581]: Invalid user erik from 210.48.230.5
Aug  1 20:23:46 zugzug sshd[15581]: (pam_unix) check pass; user unknown
Aug  1 20:23:46 zugzug sshd[15581]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.218.125.178
Aug  1 20:23:49 zugzug sshd[15581]: Failed password for invalid user erik from 210.48.230.5 port 44088 ssh2
Aug  1 20:23:51 zugzug sshd[15585]: Invalid user eduardo from 210.48.230.5
Aug  1 20:23:51 zugzug sshd[15585]: (pam_unix) check pass; user unknown
Aug  1 20:23:51 zugzug sshd[15585]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.218.125.178
Aug  1 20:23:53 zugzug sshd[15585]: Failed password for invalid user eduardo from 210.48.230.5 port 44346 ssh2


The warnings are clear: someone is trying to log in via sshd, the secure shell daemon, trying random username and password combinations. And, as great as high-bandwidth is, the downside is that malicious forces can attempt thousands of login attempts in a very short time.

Now, the right term for a person who attempts to exploit security is a cracker, but “hacker” – rightfully an inquisitive and enthusiastic person – has been popularised as a malicious meddler. Nevertheless, at this point in time semantics are the last thing on your mind: whether you're being hacked or cracked you’ve got to secure your system and keep out the bad guys.

In fact, someone successfully logging in is only one of your worries. Firstly, each attempt adds several lines to your log files. In time, a lot of disk space is wasted and your logs become almost meaningless with other information you might be seeking being well hidden amongst the tens of thousands of repetitive entries.

And, more importantly, a high-speed multi-threaded attack runs the risk of denying your service by consuming all your bandwidth – let alone system resources. And if your system is too busy handling these connections, how will you log in, yourself?

So then - what do you do?

Lock down sshd

The very first step is to beef up the security on SSH itself. Firstly, you don’t want anyone logging in to your system as root. This gives unfettered power. This doesn’t stop you remoting in to your system using an ordinary user account and su’ing to root. Edit the /etc/ssh/sshd_config file and ensure it has an entry “PermitRootLogin no”. This means ssh will just prevent root logins; any attempt will fail even if the password is right. Best of all, the failure message gives no hint the connection failed because of this rule; it looks like any other bad username/password combo. This means your cracker has to guess a genuine username and password so their work is made much harder.

Depending on how flexible your network is, you might also consider changing the port number that SSH listens on. By default, it uses port 22 and this is the port crackers will be attempting to use. You could change this to some other arbitrary port. You will still be able to SSH in, specifying the appropriate port number, but others will have no success unless they realise firstly there’s another port open, and secondly that it is used for SSH (the fact a non-standard port is open gives no immediate information as to the protocol it uses.) Once again, edit /etc/ssh/sshd_config and set a customised port number on the ListenAddress line.

This is a good start. Yet, there’s still more to do. The biggest problem is there’s no built-in mechanism to stop repeated login attempts from the same IP address, even if it is failing continually.



 
< Next story in category   Previous story in the category >
iTWire Technology feature

Virtualisation

dollsmaximise your infrastructure, maximise your business

Read more...



Search the web
Search iTWire

 
You don't need to login to post a comment





Lost Password?
No account yet? Register
Subscribe to our free daily newsletter.
Business Innovation Forum
July 24 (8:00 am) - July 25 (1:30 pm), 2008
Business Innovation Forum: a morning of innovative thinking that will help you gain business resu...

Broadband 2008
July 24 (8:45 am) - July 25 (11:59 pm), 2008
Broadband Australia 2008 The original forum for debating the future of Australia’s broadband i...

The Rapidly Emerging Mobile Media Market
July 24, 2008 (All Day)
Mobile media is the way of the future, and by 2015, it is expected that it will be the major reve...

Start Mid Year Technical Communication at Swinburne University
July 25 (9:00 am) - July 30 (11:59 pm), 2008
Last week to apply for Swinburne University’s online postgraduate Technical Communication courses...

Lean Six Sigma Black Belt Certification Workshop
July 25 (9:00 am) - July 27 (11:59 pm), 2008
eXample Consulting Group is conducting an immensely practical LEAN SIX SIGMA BLACK BELT TRAINING ...

Usability Fundamentals Training Course [Sydney]
July 28 (9:00 am) - July 29 (11:59 pm), 2008
The success of your website is inextricably linked to how well-versed those involved in the devel...

SAUG Summit 2008
July 29 (8:30 am) - July 31 (11:59 pm), 2008
The SAP Australian User Group (SAUG) "The Next Step..." Where do we go from here?...

ISEB ISTQB Foundation Certificate in Software Testing - Melbourne
July 29 (9:00 am) - July 31 (11:59 pm), 2008
This is the first internationallly accepted industry accreditation for software testing. It has b...

Open Publish Conference
July 30 (9:00 am) - July 31 (11:59 pm), 2008
Open Publish 2008 will be focusing on management and implementation issues relating to publishing...

Web 3.0: Mobile & the Semantic Web
July 30, 2008 (9:30 am - 12:00 pm)
part 2 of the 4 part semantic web forum series Speakers: - Jennifer Wilson, Principal, Lean F...
New event listings
SolidWorks Innovation Day (Melbourne and Adelaide)
October 17, 2008 (All Day)
Hosted by Intercad, SolidWorks’ Innovation Days will give designers, engineers and manufacturers ...

SolidWorks Innovation Day (Sydney)
October 16, 2008 (All Day)
Hosted by Intercad, SolidWorks’ Innovation Days will give designers, engineers and manufacturers ...

SolidWorks Innovation Day (Brisbane and Perth)
October 15, 2008 (All Day)
Hosted by Intercad, SolidWorks’ Innovation Days will give designers, engineers and manufacturers ...

LIXI Industry Forum 2008
September 10, 2008 (All Day)
Wednesday, 10 September 2008 The Westin Sydney The second annual major industry event for the...

Mobile Feast!
August 22, 2008 (All Day)
Join us as we discuss all things mobile! The history of technology tells us that the true inno...

The Business of Digital Content - Melbourne
August 5, 2008 (All Day)
The Business of Digital Content Melbourne – August 5, 2008 Extract maximum value from your...

View Full Calendar
Subscribe to our free daily e-newsletter
Contact , Register , Advertise with iTWire , Links , About iTWire , Feedback , Post your jobs , Events , iTWire site map , Start Blogging , MyBlogLog page
Industry Releases , Submit your release now