LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-05-2013, 10:25 AM   #1
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Rep: Reputation: 15
Trouble with ssh


I have a slackware (13.37 I believe) system that is basically used as a family file server. I have been away from the home for a long time and only way I was connecting was through a secure shell that was working, which I have not done in a while. I went to go in and it won't connect with a secure shell program (securecrt). Due to storms and what not linux and the router were shut off giving it a new IP address. We can from the console ping a computer from outside and get a responce, nmap shows linux is listening on the internal IP address. From a windows machine in same room portqry shows it is listening on port 22, but can not ssh in. Portqry from another country shows the external IP is listening on port 22. Router/modem had port forwarding to the linux ip and since portqry showed it was listening I assume that is working. SSH WILL NOT work in same room or in other country. I thought it might have been the host.allow file preventing it but removed everything dealing with ssh except for all. I am considering finding a way to talk to someone in the house that is helping me and upgrading from slackware 13.37 to slackware 14 once we can arrange for the dvd's to be made and set asside the proper amount of time, but would like to make sure i can get this working again before going through all this trouble and time. Considering it not me at the console and I am relying on someone else viewing the /var/log/secure log I am told someone else was able to get in but I not so sure of this think it was an attempt that failed, but I have not ruled out that this is the problem. the /etc/resolv.conf has search set for localhost and isp as well as primary and secondary nameservers for their dns numbers. Any suggestions on what else I could check would be greatly appreciated. Thank you in advance on any help you can shed on this situation.
 
Old 06-06-2013, 08:53 PM   #2
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Rep: Reputation: 174Reputation: 174
Your router getting a new dynamic IP address from your ISP back home should not affect anything so long as the target of your ssh is either the newly assigned IP address or a properly updated dynamic DNS name.

You might have someone back home set LogLevel DEBUG in the sshd_config so you get more detailed logging. Besides /var/log/secure, you might also want to check for sshd messages in other places like /var/log/syslog and /var/log/messages.
 
Old 06-07-2013, 03:44 AM   #3
akiuni
Member
 
Registered: Sep 2012
Location: France
Distribution: debian
Posts: 56

Rep: Reputation: Disabled
Hello

Do you know if the slackware box is setup in DHCP ?
Maybe this box got another local IP address after the shutdown and the "ListenAddress" directive of ssh_config isn't correct anymore ? Or if you set up iptables on this box, the rule are not corresponding anymore ?
 
Old 06-08-2013, 11:40 AM   #4
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
The router has the forward set to the linux IP address and in linux the /etc/resolv.conf looks like this
Quote:
search localhost verizon.net
nameserver 71.242.0.12
nameserver 78.237.161.12
and the dns numbers were retrieved from the supplied isp router/modem so they were updated. But this nor IPTABLES would not prevent an internal connection with ssh to the linux computer and it is. Due to work schedules we should be able to set loglevel to DEBUG in the sshd_config and test it sometime today. I set up the slackware box so I know for a fact that it is NOT set up as DHCP and is set up as a static address and far enough up that the router wouldnt even try to hand this address out for it starts handing out addresses starting at 192.168.1.2 and hands them out in numerical order and the slackware box is now and always has been 192.168.1.199 as far as IPTABLES blocking me from outside getting in I can see that possible for I have changed ISP's but IPTABLES wouldn't block an internal computer and it is, I don't have it block internal addresses for a safety measure if I can't get in for some reason on one computer in the house I can try another in the house and it should work. I think it is something that the ISP is doing or the router/modem not forwarding even though the forwards have been removed and re-added but will see sometime today when we get to work on this.
 
Old 06-08-2013, 03:40 PM   #5
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Rep: Reputation: 174Reputation: 174
This has nothing to do with the problem you are having with ssh, but 78.237.161.12 isn't a Verizon DNS server. It's part of an assigned block of addresses in France. I'd suggest removing that from your resolv.conf. I would remove verizon.net from the search directive and just leave localhost there. Maybe add another DNS address to replace the invalid one, like Google DNS address 8.8.8.8, so you have two valid name servers listed.

It's a good idea to assign a static IP address to the system you want to ssh to since your firewall port forwarding rules in your router depend on it being unchanging.

After you turn on LogLevel DEBUG and restart sshd with "/etc/rc.d/rc.sshd restart", look in /var/log/syslog and /var/log/messages for sshd messages. Note that the sshd_config man page states that "Logging with a DEBUG level violates the privacy of users and is not recommended." With that in mind, be sure to carefully review the output of "cat /var/log/syslog | grep sshd" and "cat /var/log/messages | grep sshd" if you decide to post it. If you post any logs, please wrap them in CODE tags.
 
Old 06-08-2013, 09:16 PM   #6
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
I apologize that was a typo should have been 68.237.161.12. I do believe it is a problem with the router/modem not port forwarding, even tried adding it as a DMZ but the linux logs get no entries for log in attempts, none at all. Even tried changing the port to one above 1024 and that didn't work either. There was a conflict in the logs that I solved for time being until ssh is fixed then i will investigate deeper. SSH, Samba and ftp were all trying to bind to address 0.0.0.0 until ssh is back up and working I have turned samba and ftp off (commented out ftp in /etc/services and chmod 444 /etc/rc.d/rc.samba after it was stopped). Verizon may have stopped this because they considered it a server, but it internal and I only log in if there a problem or I am notified that something is not working. One thing I did notice other then the port forwarding not working is when I run from windows

Code:
portqry -n IPADDRESS -e 2222
it fails to resolve ip address to name and goes on to say that port is filtered. Port 2222 is what we set ssh to when 22 wasn't working.
 
Old 06-08-2013, 11:37 PM   #7
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Rep: Reputation: 174Reputation: 174
I forgot to mention, you should also check /var/log/debug, as that is where the sshd debug messages will go. If the request is making it through your firewall to your ssh server, there should be some indication in there.
 
Old 06-09-2013, 01:27 AM   #8
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by KrazyKanuk View Post
Verizon may have stopped this because they considered it a server, but it internal and I only log in if there a problem or I am notified that something is not working.
Verizon is my ISP. They don't block port 22.
 
Old 06-10-2013, 08:08 AM   #9
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
Something is going on and it don't make sense, last night before I left for work portqry couldn't resolve the IP address to a name and when I did a whois on the IP address it came cack as belonging to Comcast, this morning it resolves the IP to a name and whois shows it from verizon. But it is also showing that the port is closed. ANd before anyone asks yes I put the numbers in right didn't this morning only ran same ones I did last night.
 
Old 06-10-2013, 09:10 AM   #10
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
form the outside computer run, as root, nmap -p22 <WAN_SIDE_IP>

it will look something like this:

Code:
[root@server ~]# nmap -p22 URL

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-06-10 10:08 EDT
Interesting ports on xx-xx-xx-xx.res.bhn.net (xx.xx.xx.xx):
PORT   STATE    SERVICE
22/tcp filtered ssh

Nmap finished: 1 IP address (1 host up) scanned in 0.920 seconds
as you can clearly see i block port 22 and I do use a different port to access my home via the WAN.
 
Old 06-11-2013, 04:57 PM   #11
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
I will get the old router hooked up for me and see if a ssh connection can be made then it will prove or disprove my thoughts that it the verizon supplied router/modem that you search on shows all kinds of issues of it not forwarding.
 
Old 06-19-2013, 12:43 AM   #12
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
*** UPDATE ***

Connected old router and added a Windows computer and the Linux computer to one of the open ports of the router (with it like this there was no internet access). Made sure port forwarding was correct port and pointing to the Linux computer. It still didn't work, but the connection was getting to Linux for it made an entry in the log. It turned out when I had them delete the addresses in the hosts.allow they deleted too much, fixed that and then we were able to ssh in from the Windows computer that was connected to the same router as the Linux computer.

Still had same problem when it was hooked back up to the original router and to the internet. For some reason that I can't understand why it would work if I set the Linux computer up as DMZ and connected on port 2222, I checked the /etc/ssh/sshd_config and it was set to 22. I have no idea where it was getting the 2222 from but it was working.

With it working I got either brave or stupid however you want to look at it and did the Slackware upgrade to Slackware 14 using slackpkg commands. All seemed to go well and at end I didn't run lilo for I had replaced this with grub2 some time ago. I ran the
Quote:
grub-mkconfig -o /boot/grub/grub.cfg
to have the new kernels added to the grub2 menu. None of the 2 new kernels would boot one gave long list of errors that when asked was just told it filled screen and other gave kernel panic on the ext4 filesystem so something wasn't getting loaded in the kernel that should have. My 3.2.12 kernel would load but without network, when I told this I remembered seeing stuff being deleted and wondered if this was part of what was deleted. Anyway if I went into the directory containing the module it would load the driver for my realtek card and I could add an address and default route gateway. This has to be done after every boot.

Even with it up and running connecting from outside was not getting through was getting
Quote:
The remote system has refused your connection
almost as soon as I tried the right computer was still DMZ and tried on port 22 and 2222 with same result. Decided to install the Slackware 14 from DVD and then try knowing it is possible for it to get through, just wonder if the router has some sort of cache system. Due to work we wont be able to tackle this until the weekend after next.
 
  


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
SSh trouble lola1987 Linux - Server 4 06-05-2011 06:15 AM
SSH trouble in OS X morelandjs General 7 12-28-2009 06:39 PM
putty and ssh trouble section31 Linux - Software 5 08-13-2006 10:24 AM
PVM Trouble with ssh! funkymunky Linux - Software 0 02-29-2004 09:16 AM
Having trouble configuring SSH Travis86 Linux - Networking 3 06-19-2003 09:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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