LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 07-08-2006, 06:45 AM   #1
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Rep: Reputation: 15
SuSE firewall won't let me ssh to the box


Hi!

I know for sure that SSH deamon is running. I tried flushing the iptables rules, but it didn't help. How can I turn the firewall off, so I can ssh to the box?
 
Old 07-08-2006, 06:57 AM   #2
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
turning the firewall off is not the solution. you should add a rule to the firewall which makes iptables let you ssh into the box. something like this
Code:
/sbin/iptables -A INPUT -p tcp -s $DESTINATION -d $SOURCE --dport $SSH_PORT -j ACCEPT
make sure you have a entry like this in your /etc/hosts.allow file
sshd : $DESTINATION

and you do not have the same in /etc/hosts.deny

where $DESTINATION is the ip you want to ssh from, $SOURCE is the ip of the machine your are trying to ssh and $SSH_PORT is the port number of SSH in the source which by default is 22 but can be set to anyother value.

Last edited by prozac; 07-08-2006 at 07:03 AM.
 
Old 07-08-2006, 07:33 AM   #3
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Original Poster
Rep: Reputation: 15
Hello,
I did everything you suggested:

a) I added "sshd : 192.168.2.8" to /etc/hosts.allow
b) I commented "http-rman : ALL EXCEPT LOCAL" in /etc/hosts.deny
c) I executed the rule you suggested (only with /usr/sbin/iptables)

192.168.2.8 is my laptop, 182.168.2.6 is the SuSE box and 182.168.2.1 is my belkin router.

The situation is still the same, Putty just returns an error: Network error - connection timed out. :\
 
Old 07-08-2006, 07:43 AM   #4
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Original Poster
Rep: Reputation: 15
I checked my rulelist (iptables -L) and this is what I see under Chain INPUT (policy DROP):
Code:
ACCEPT tcp -- 192.168.2.8  username   tcp dpt:ssh
Is this correct?
 
Old 07-08-2006, 08:01 AM   #5
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Original Poster
Rep: Reputation: 15
I managed to SSH into my box now by stopping the firewall by executing:
Code:
/sbin/SuSEfirewall stop
But I still need to 'repair' iptables so it will let me in even when the firewall is on.

Any suggestions?
 
Old 07-08-2006, 08:15 AM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
YAST -> Security & Users -> Firewall -> Allowed Services -> SSH.
 
Old 07-08-2006, 10:11 AM   #7
carcassonne
Member
 
Registered: Jul 2005
Distribution: Fedora6 x86_64
Posts: 118

Rep: Reputation: 15
Quote:
Originally Posted by ilhbutshm
I know for sure that SSH deamon is running. I tried flushing the iptables rules, but it didn't help. How can I turn the firewall off, so I can ssh to the box?
I'm surely missing something here, so don't pay too much attention.

Click on the firewall icon of Yast, set ssh as allowed service. Could be too simple, dunno. That's what I do and it works. SuSE 9.3 and 10.0.
 
Old 07-08-2006, 11:17 AM   #8
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Original Poster
Rep: Reputation: 15
Thanks, but I'm working in text-mode here
 
Old 07-08-2006, 02:44 PM   #9
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
Originally Posted by ilhbutshm
Thanks, but I'm working in text-mode here
YAST has a text only interface that runs if you are not in a GUI or did not install the GUI version.
 
Old 07-08-2006, 05:09 PM   #10
ilhbutshm
Member
 
Registered: Jul 2003
Location: Europe
Distribution: Slackware 10.2
Posts: 104

Original Poster
Rep: Reputation: 15
Silly me!

I found the "Firewall configuration: Allowed services" section.. but I am not able to choose SSH... I can only select Internal, External and Demilitarized zone (what's the difference?)

I don't know which key to press to be able to select a service under Internal Zone (this sounds so lame :\)
 
Old 07-08-2006, 06:32 PM   #11
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
Originally Posted by ilhbutshm
Silly me!

I found the "Firewall configuration: Allowed services" section.. but I am not able to choose SSH... I can only select Internal, External and Demilitarized zone (what's the difference?)

I don't know which key to press to be able to select a service under Internal Zone (this sounds so lame :\)
External Zone should be already selected for you. Press tab until you get to Service To Allow and then press the down arrow key. A list of services will be show and you can press enter to choose the one you wish.
 
Old 07-08-2006, 09:37 PM   #12
nlinecomputers
Member
 
Registered: Aug 2005
Location: Midland, TX
Distribution: Ubuntu
Posts: 125

Rep: Reputation: 15
In the text version of Yast you can select item by hitting the ALT key and the yellow highlighted letter. So you hit ALT-S to get the selction list to find SSH and get it turned off.
 
Old 07-08-2006, 09:49 PM   #13
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The internal, external and DMZ are the zones that you may associate a particular zone with. You then need to indicate which services are allowed for which zone. If your computer is between two firewalls, running a public service like http, then you might want to use DMZ. If you are behind a NAT router and not having anything forwarded to your box, you might use "internal". By default, internal isn't protected by the firewall. Otherwise, you want to choose external. A computer that is hooked up directly to a modem and provided internet access for other computers on the lan has 2 interfaces. One is external and the other is internel.

SSH uses port 22 by default. Some people change the default port because it is a well known target. If you are the only person to use SSH, then uncomment the "AllowUsers" line and add your user name to it. This will disable connection attempts using system usernames. Script kiddies have scripts that will try a number of passwords attacking the usernames of common system users, such as mail, video, mysql and root.
 
  


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
Understanding SSH (Sun box to Linux box) oswald21 Linux - Newbie 2 07-08-2006 02:06 PM
Cannot ssh to debian box from Gentoo box or Putty, but I can from Cygwin? Pengus Linux - Networking 2 01-20-2006 12:47 PM
Cannot see my Win XP SP2 box with shared printer from my SUSE Pro 9.3 box thorlin Linux - Networking 3 09-11-2005 01:16 PM
XP Box won't connect to internet thru RH9 Box (firewall/dhcpd), it can only ping fire Rhapsodic Linux - Networking 4 07-10-2004 03:02 PM
SSH help - need to access box behind a firewall and cannot fwd ports. absolutal Linux - Networking 13 07-16-2003 12:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 02:15 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