LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-24-2012, 06:50 AM   #1
Blunda
Member
 
Registered: Oct 2008
Posts: 40

Rep: Reputation: 0
SSH timing out


Hello

I am attempting to make an ssh connection between 2 linux boxes. One is running sabayon 10 and the other is running crunchbang wich is a debian varient. Now I am able to SSH from the sabayon box to the crunchbang box but when I try to SSH from the crunchbang box it just times out.

I am fairly new to linux so Im not sure which logs to look at.

Any help would be much appreciated.
 
Old 10-24-2012, 07:16 AM   #2
dushyantgohil
Member
 
Registered: Aug 2011
Location: India
Distribution: Cent OS & Ubuntu
Posts: 107

Rep: Reputation: 3
have you installed ssh server?
check SSH service is runnning
is port of ssh is opened

check with these things.
 
Old 10-24-2012, 07:21 AM   #3
FrankP
Member
 
Registered: Aug 2003
Location: Britain
Distribution: AntiX, Debian, Gentoo
Posts: 65

Rep: Reputation: 18
Hi, if the connection is established but then times out, and especially since your problem occurs one way round and not the other, it might be down to the ISP providing one end of the connection. Is that so for your setup? For example, if the #! box is on cable or ADSL your ISP might have policies in place that terminate always-open connections.

In my case, with VirginMedia in the UK, I have found adding a ~/ssh/config file with following settings in has helped:
Code:
Host *
ServerAliveCountMax=20
ServerAliveInterval=45
Your mileage may vary, but experimenting with these settings or similar may be worthwhile.

To check logs (if necessary) then look at /var/log/auth.log on the destination host. It should record every attempt at authentication but may not provide much more help.
The global config for ssh is set by /etc/ssh/ssh_config (outgoing) and /etc/ssh/sshd_config (incoming).
 
Old 10-24-2012, 07:51 AM   #4
Blunda
Member
 
Registered: Oct 2008
Posts: 40

Original Poster
Rep: Reputation: 0
Hello

SSH is installed on both servers and it is running on both, this has been checked.

how do i check ssh port is open?

Connecting from #! to sabayon doesnt connect at all just times out attempting to connect. Although funnyly enough I am also on virgin media. but if it is down to ISP surely it shouldnt go either way? both these servers are on the same lan with the same subnet mask.
 
Old 10-24-2012, 08:42 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Blunda View Post
...how do i check ssh port is open?...
Code:
telnet sabayon 22
is the easy test
 
Old 10-24-2012, 08:47 AM   #6
epislav
LQ Newbie
 
Registered: Jun 2012
Posts: 20

Rep: Reputation: Disabled
or run iptabes-save and post result
 
Old 10-24-2012, 08:51 AM   #7
epislav
LQ Newbie
 
Registered: Jun 2012
Posts: 20

Rep: Reputation: Disabled
or try:
iptables -P INPUT ACCEPT
which will allow all incomming connections till reboot
 
Old 10-24-2012, 10:17 AM   #8
Blunda
Member
 
Registered: Oct 2008
Posts: 40

Original Poster
Rep: Reputation: 0
@epislav - iptables -P INPUT ACCEPT woked! Thanks

Im guessing that means the firewall is blocking port 22? How do I add it to exceptions?
 
Old 10-24-2012, 11:48 AM   #9
Blunda
Member
 
Registered: Oct 2008
Posts: 40

Original Poster
Rep: Reputation: 0
HELP! I have made the below script to allow the ssh port which works but now I am unable to connect to internet no matter what! I saved the iptables so restarting dosent help either! Any help would be much appreciated thanks!

#!/bin/sh
# My system IP/set ip address of server
SERVER_IP="65.55.12.13"
# Flushing all rules
iptables -F
iptables -X
# Setting default filter policy
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
# Allow unlimited traffic on loopback
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# Allow incoming ssh only
iptables -A INPUT -p tcp -s 0/0 -d $SERVER_IP --sport 513:65535 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s $SERVER_IP -d 0/0 --sport 22 --dport 513:65535 -m state --state ESTABLISHED -j ACCEPT
# make sure nothing comes or goes out of this box
iptables -A INPUT -j DROP
iptables -A OUTPUT -j DROP
 
Old 10-24-2012, 02:54 PM   #10
Blunda
Member
 
Registered: Oct 2008
Posts: 40

Original Poster
Rep: Reputation: 0
Its OK! Ive worked it out. Helps to be able to read!
 
  


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] SSH keeps timing out from just one computer acampbell Linux - Networking 6 01-07-2012 06:11 AM
ssh connection timing out Ubuntu 10.04 kells Ubuntu 6 11-15-2010 07:03 AM
ssh timing out SciSteve Linux - Newbie 4 05-18-2010 07:55 PM
SSH remote command not timing out tajsss Other *NIX 5 04-28-2005 06:57 AM
SSH timing out/not connecting NeccoWolf Linux - Networking 2 01-26-2003 02:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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