View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 8 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Can only SSH in locally
PostPosted: Mon Nov 30, 2009 7:05 pm 
Offline
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location: Virginia, USA
Just upgraded to R6 and am gradually trying to get things back to the way they were in R5.5. Here's the latest one I can't figure out.

I know mythtv and root are denied ssh access.

I can ssh into my machine when I do it from a local machine (IP # 192.168.blah) and from the one user account I set up when installing R6.

I can't log in, however, when I am outside of my network. It doesn't even prompt me for username. For instance, when I use putty I get "server unexpectedly closed network connection."

I have tried:
* adding an "AllowUsers" and my one account username to /etc/ssh/sshd_config
* tried commenting out the "ALL: ALL: DENY" line in /etc/hosts.deny

I do a "sv restart sshd" after each of those attempts and still can't connect.

What else should I be looking at? Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 30, 2009 7:13 pm 
Offline
Joined: Sun Sep 25, 2005 3:50 pm
Posts: 1013
Location: Los Angeles
Here's what I have and I have no issues from WAN or LAN:

Code:
$ cat /etc/hosts.allow
#
# /etc/hosts.allow
#
ALL: 192.168.
ALL: 10.
ALL: 127.0.0.1
# End of file

$ cat /etc/hosts.deny
#
# /etc/hosts.deny
#

#ALL: ALL: DENY

# End of file

_________________
Mike
My Hardware Profile


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 30, 2009 8:09 pm 
Offline
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location: Virginia, USA
Thanks; coulda sworn I restarted sshd after commenting out the hosts.deny line, but I must not have, because now it works. Appreciate the double-check.


Top
 Profile  
 
PostPosted: Sat Feb 13, 2010 9:56 am 
Offline
Joined: Mon Dec 18, 2006 1:20 pm
Posts: 98
Location: Krakow, Poland, EU
I confirm that commenting the line
Quote:
#
# /etc/hosts.deny
#

# ALL: ALL: DENY

is the easiest way to allow ssh connexions from WAN. The change took effect immediately, no sshd restart requiered. Unfortunately, it also lowers security.

I tried a few other ways to selectively open access over ssh from the WAN, but they all failed; for instance:
Quote:
#
# /etc/hosts.allow
#

ALL: .adsl.myisp.com: ALLOW

fails to grant access from a host in that domain, or even
Quote:
#
# /etc/hosts.deny
#

ALL: ALL: ALLOW

seems ineffective (perhaps the command ALLOW is ignored in /etc/hosts.deny fileĀ ?). Connexion reads the following message, then drops:
Quote:
ssh_exchange_identification: Connection closed by remote host

Somebody skilled might turn us to a configuration better balanced between accessibility and security.

BTW, here is an easy to read how-to covering /etc/hosts.allow and /etc/hosts.deny syntax :
HOWTO - Limiting Access to TCP-wrapped services with hosts.allow


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 13, 2010 10:39 pm 
Offline
Joined: Sat Sep 02, 2006 1:46 pm
Posts: 44
I think I had the same problem and stumbled upon this setup that works (can't remember where I got this solution):

Code:
$ cat /etc/hosts.allow
#
# /etc/hosts.allow
#
ALL: 192.168.
ALL: 127.0.0.1
sshd:ALL
# End of file

$ cat /etc/hosts.deny
#
# /etc/hosts.deny
#

ALL: ALL: DENY

# End of file
$


Seems a little more secure since it only opens up sshd to the whole world. Maybe there is an even more secure setup?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 13, 2010 8:22 pm 
Offline
Joined: Wed May 09, 2007 8:47 pm
Posts: 367
Location: Minnesota- Brrrrr!
No restart of system or service needed: add the bolded line:

[root@mythtv ~]# cat /etc/hosts.allow
#
# /etc/hosts.allow
#
sshd:ALL
ALL: 192.168.
ALL: 10.
ALL: 127.0.0.1
ALL: 172.16.
# End of file

_________________
R7.3: 0.22.20091023-1, Hauppauge PVR-500 (Philips FQ1236A MK4), Gigabyte Gigabyte EG45M-UD2H, E5200 2.4Ghz, 2GB RAM, NVIDIA GEFORCE 256MB


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 14, 2010 9:29 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Also recommended on the _useful_ security through obscurity front, if you're going to expose it to the outside changing your default ssh port can effectively reduce your exposure. Friends in the network security world tell me that the number of probes they see against default ports versus nonstandard ports are hundreds or even thousands to one. At the very least it'll reduce the amount of noise in your log files...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 14, 2010 12:18 pm 
Offline
Joined: Wed May 09, 2007 8:47 pm
Posts: 367
Location: Minnesota- Brrrrr!
Additional Guidance and discussion regarding adaptive SSH security found in this thread: http://knoppmyth.net/phpBB2/viewtopic.php?p=129317#129317

_________________
R7.3: 0.22.20091023-1, Hauppauge PVR-500 (Philips FQ1236A MK4), Gigabyte Gigabyte EG45M-UD2H, E5200 2.4Ghz, 2GB RAM, NVIDIA GEFORCE 256MB


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu