[SOLVED] SSH - No access to internet

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
chrisdasp

[SOLVED] SSH - No access to internet

Post by chrisdasp »

Hello,

I recently configured my main computer as a server for SSH (which works in LAN) but I cannot access to the internet at all.

How can I do to have the access to internet and when I want put him on server mode accessible on SSH?

Is there any command on terminal to stop that, let him connect to internet and be a normal computer, and when I want just active a command to put it as a SSH server?

Thanks in advance,
Chris
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
deepakdeshp
Level 20
Level 20
Posts: 12334
Joined: Sun Aug 09, 2015 10:00 am

Re: SSH - No access to internet

Post by deepakdeshp »

When you installed your computer, it should be connected to a router which I connected to the internet.In this case your machine will be automatically configured to connect to the internet.
The machine can be connected to the net and run ssh at the same time.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
chrisdasp

Re: SSH - No access to internet

Post by chrisdasp »

So the only one way to get the access to internet from a computer who is configured with SSH, it's via a cable Ethernet?
There is no way through the Wifi?
JeremyB
Level 21
Level 21
Posts: 13851
Joined: Fri Feb 21, 2014 8:17 am

Re: SSH - No access to internet

Post by JeremyB »

Are you sure your ISP doesn't block the port used by SSH? I think it is port 22
chrisdasp

Re: SSH - No access to internet

Post by chrisdasp »

JeremyB wrote: Sun Nov 18, 2018 8:16 am Are you sure your ISP doesn't block the port used by SSH? I think it is port 22
I truly do no know what is it. Just followed a tutorial on the web to set up a connexion SSH on my main computer, which works, but I cannot access to internet from this computer anymore.

How is it possible to check this ISP thing on port 22?
JeremyB
Level 21
Level 21
Posts: 13851
Joined: Fri Feb 21, 2014 8:17 am

Re: SSH - No access to internet

Post by JeremyB »

chrisdasp

Re: SSH - No access to internet

Post by chrisdasp »

It says the port 22 is closed on my IP address.

Does it mean my SSH server is blocking it?
It said the same for the port 80 by the way.
JeremyB
Level 21
Level 21
Posts: 13851
Joined: Fri Feb 21, 2014 8:17 am

Re: SSH - No access to internet

Post by JeremyB »

You could try a telnet command from outside

Code: Select all

 telnet  ipaddress 22
Neil Darlow

Re: SSH - No access to internet

Post by Neil Darlow »

If I understand your post correctly, you have configured a system to run a SSH service which you can access from your network but not externally from the Internet?

Your Internet connection will be managed by a router of some type (ADSL or Cable) and to permit external SSH connections you need to do two things on the router:
  • Open Port 22
  • Forward Port 22 of the router to Port 22 of your SSH server IP address
Regards,
Neil
User avatar
BG405
Level 9
Level 9
Posts: 2507
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: SSH - No access to internet

Post by BG405 »

My interpretation is that the OP's machine isn't able to access web pages. To find out if there is any connectivity, try pinging a known IP e.g. ping -c3 8.8.4.4 & if this returns timings, you could also run this:

Code: Select all

wget -O - https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python
Having SSH connections should not inhibit internet connectivity; I use it all the time on my home network & do also use it to connect to remote machines. My router does not currently have the incoming ports open therefore I also can not access from outside, but that is my preference. I'd suggest using a different port for SSH as you do want it open.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
chrisdasp

Re: SSH - No access to internet

Post by chrisdasp »

BG405 wrote: Sun Nov 18, 2018 1:41 pm My interpretation is that the OP's machine isn't able to access web pages. To find out if there is any connectivity, try pinging a known IP e.g. ping -c3 8.8.4.4
The terminal says that 100% packets were loss, Destination Host Unreachable.
BG405 wrote: Sun Nov 18, 2018 1:41 pm & if this returns timings, you could also run this:

Code: Select all

wget -O - https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python
Having SSH connections should not inhibit internet connectivity; I use it all the time on my home network & do also use it to connect to remote machines. My router does not currently have the incoming ports open therefore I also can not access from outside, but that is my preference. I'd suggest using a different port for SSH as you do want it open.
So basically I cannot do that neither because I have no internet, even though I can connect my other laptop to this one through SSH in LAN.

I still do not know what I could do here :?
User avatar
BG405
Level 9
Level 9
Posts: 2507
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: SSH - No access to internet

Post by BG405 »

I'm currently at a bit of a loss here but did you set the IP address(es) manually or are you using DHCP?

If the former, you might have to add the DNS server address(es) for your ISP or whichever one you normally use, assuming you haven't already; sure I had to do that on this machine (which is using a fixed IP address). You could use one of Google's (e.g. the one I posted above) as a test, or copy from another machine which is connecting OK.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
chrisdasp

Re: SSH - No access to internet

Post by chrisdasp »

I did this command that you provided above which is

wget -O - https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python

and basically from this laptop it works but it does not from the computer with the SSH configured. Even if I try to do through the SSH as if I was on the other machine.

So I do have the impression there is internet on the computer SSH configured, but only on entrance (I can connecte SSH LAN), but cannot have the access to webpages or even sudo apt update.
User avatar
BG405
Level 9
Level 9
Posts: 2507
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: SSH - No access to internet

Post by BG405 »

Could you post the output of nmcli device show from the affected machine (probably easiest via SSH for copy & paste) and also inxi -Fxz? Note inxi won't show all graphics card data unless you use ssh -X, if it's configured, but that shouldn't matter in this case. This may be helpful. :)
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
chrisdasp

Re: SSH - No access to internet

Post by chrisdasp »

Edit :

Okay I just thought about reseting my internet parameters as default following this tuto :
https://askubuntu.com/questions/835195/ ... to-default

And it worked, I actually installed Wake On Lan on the machine and for some reason the config file was with additional lines that changed my IP to static instead of DHCP...

In case if someone has the same problem here is the answer, thanks everybody for your help, learned something today 8)


Chris'
Locked

Return to “Networking”