LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-22-2011, 08:10 PM   #1
illu5ion
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Rep: Reputation: 0
Unlocked port 22 on my ufw accidentally..


I had just got Arch up and running a couple weeks back, and I was following a random user's guide (previous Ubuntu user and newb to Linux in general)-- I think it may have been a mistake.

When I was configuring my iptables/ufw, I'd added a rule to iptables allowing ssh to be used from anywhere (I think so anyhow); it came up as something along the lines of 'ALLOW: IN : ANYWHERE: ssh 22' in red font on gufw. This had been open for about a few days, and I didn't realize the security risk until I learned what ssh is.

So is it likely that my system is compromised and needs a full hard drive wipe? hosts.deny remained in its default state, so wouldn't that override the iptables configuration or no? Could my router have kept any potential threats out like it has before despite the rule?
 
Old 01-22-2011, 10:48 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by illu5ion View Post
Could my router have kept any potential threats out like it has before despite the rule?
Sure. I mean, you're saying this box was behind a NAT router that was not configured to forward traffic to TCP port 22, right? If so, then your SSH daemon was never exposed to the Internet. That said, you can check /var/log/auth.log for evidence of remote login activity.

Last edited by win32sux; 01-22-2011 at 10:49 PM.
 
1 members found this post helpful.
Old 01-22-2011, 11:36 PM   #3
illu5ion
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Yes, I'm behind an NAT router and the router wasn't configured to allow access to port 22. I'd checked that before and didn't see anything unusual, but just to make sure I'll look over it once more. Thanks for the help.

Last edited by illu5ion; 01-22-2011 at 11:37 PM.
 
Old 01-23-2011, 02:25 AM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
If your system was updated for security updates and your root password was not something like "admin" there is little to worry.

Most servers exposed to the internet have port 22 open to allow access for the administrator. That is a lot worse as what you have.

Be sure however that root is not allowed SSH access, that users don't have and obvious password and that the root password is sufficiently secure.

Besides checking auth.log you could check if you machine is compromised with chrootkit or another root kit detection program.

jlinkels
 
Old 01-23-2011, 05:44 PM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by illu5ion View Post
Yes, I'm behind an NAT router and the router wasn't configured to allow access to port 22. I'd checked that before and didn't see anything unusual, but just to make sure I'll look over it once more. Thanks for the help.
No problem. Let us know if you find anything.
 
  


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
[SOLVED] ufw judoka Linux - Networking 5 07-08-2010 03:03 PM
ufw firewall rhlnewbie Linux - Software 2 10-18-2009 03:23 PM
ufw in Slackware mattydee Slackware 2 05-19-2009 02:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:46 PM.

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