LinuxQuestions.org
Help answer threads with 0 replies.
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 11-30-2017, 12:43 PM   #1
Dantaliion
LQ Newbie
 
Registered: Nov 2017
Posts: 18

Rep: Reputation: Disabled
Unable to connect to server (SSH and Netcat)


I set up a server at home (SSH on a tablet running Termux) and asked my neighbour for his WPA key so i could test it. I wasn't able to SSH to it with my laptop (Kali Linux, up to date, yes), it kept timing out (i set timeout to 10s) and tryed setting up Netcat on the same forwarded port, and enabled verbose. This was the output:
Code:
 Warning: forward host lookup failed for "$serverip": Unknown host
I was able though, to normally connect with the terminal on my phone (Termux), which means this is client-side, on my laptop, as i have previously accessed this server within a LAN. (I flushed Iptables rules, just to help with info). Any thoughts?
 
Old 11-30-2017, 05:49 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,358

Rep: Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233
I am unfamiliar with termux but I do have a few suggestions.

Is the tablet on your LAN or is it using 3/4G connection? You should be able to connect your laptop to your tablet on a LAN just like your phone. That would make troubleshooting easier. Since termux does not use passwords, did you copy the private key to your users .ssh/ directory on the laptop? Private keys permissions need to be 600.

According to the documentation the default port is 8022. Since termux does not use the default port i.e 22 you need to specify the actual port used via the ssh -p option if using the ssh command line utility. I would also specify the key on the command line using the -i option. See ssh man page for details.

Which device was your you neighbor's wifi? The tablet or the laptop?

https://wiki.termux.com/wiki/SSH

Here is someone that got it working.
https://superuser.com/questions/1199...n-to-ip-closed

Last edited by michaelk; 11-30-2017 at 05:55 PM.
 
1 members found this post helpful.
Old 12-01-2017, 01:23 PM   #3
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat CentOS Fedora SuSE
Posts: 328

Rep: Reputation: 50
Is that $serverip defined somewhere ? Do it include spaces or non-ASCII characters ?
Also, try the same with "LANG=C" instead of your locale.
 
Old 12-01-2017, 04:11 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,393

Rep: Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746
Could be that netcat is trying to lookup even though you supplied the ip. Think there is some option in manual. -n??

Anway, netcat is a terrible tool for troubleshooting.
 
Old 12-03-2017, 11:59 AM   #5
Dantaliion
LQ Newbie
 
Registered: Nov 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
Solved

Thank you for the replies! The problem was my ISP, which doesn't resolve addresses belonging to different ISP's.. That's why i can SSH to it from my phone, i was using 3G.
 
Old 12-04-2017, 02:23 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,393

Rep: Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746
Thanks for the update and solution.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Unable to connect to server via ssh - used to work in the past hmalissa Linux - Server 2 11-15-2017 05:35 AM
use netcat as a bridge to connect two server samanp Linux - Networking 3 04-11-2011 03:21 PM
New ISP / modem... Unable to connect to ssh server (or ping) remotely Lyle Linux - Networking 6 03-07-2011 01:04 PM
Unable to connect to redhat 5 server using ssh, ftp. Avadhut Linux - Newbie 6 03-12-2009 12:18 AM
Unable to connect via ssh BlackBone Linux - Newbie 11 08-25-2007 09:03 AM

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

All times are GMT -5. The time now is 06:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration