D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Laptop problem

 

On 06/12/17 11:58, Neil wrote:

> So I cannot follow your excellent advice. Meanwhile, I have never used
> SSH before, after 18 years of Linux, so I will just leave it for the
> moment. Perhaps sometime in the future .... I might even get a new
> router eventually.

Wow, you guys ended up making quite a meal of that :|

You were nearly there - on charlie you had successfully
installed+started SSHD, found the username (neilwin) and the IP address
of the wifi connection (192.168.1.10). Connecting from another machine
on the same subnet is as simple as

ssh neilwin@xxxxxxxxxxxx

Now you know SSHD is working fine on charlie because your systemd snip
clearly shows you connecting successfully on loopback 127.0.0.1 (this is
what "ssh localhost" tests). However it didn't work testing it across
the network from the desktop machine - this is going to be because of a
firewall filtering/blocking traffic on the laptop, as I warned you it
might.

So, on charlie, your next step is to examine and configure the firewall.
I happen to know the firewall in question is going to be ufw - there's a
GUI to control this you'll probably prefer called "gufw" and if it's not
installed already then feel free to add it with:

sudo apt install gufw

But GUIs are for weaklings so we'll configure it properly in a shell as
god intended. On charlie:

sudo systemctl status ufw.service
sudo ufw status
sudo ufw allow ssh
sudo ufw reload

This will check the status of the firewall systemd unit, print the
current rules, enable SSH on TCP:22 (it enables IPv6 SSH as well but
let's not worry about that) and reloads the ruleset.

If you connect from another machine to charlie after the changes, you
will now be greeted by a standard login prompt. If not, report back - it
could be that your router separates your wired and wireless network
segments into different collision domains/subnets and doesn't route
between them, although that would be pretty weird for a home router.

To be concise, here are the list of steps you need to go through on the
rest of your machines and enable SSHD from scratch if desired (your
desktop for example, and definitely the dodgy laptop). I assume a Debian
based distro with systemd in these examples.

sudo apt update && sudo apt dist-upgrade
sudo apt install openssh-* -y
sudo systemctl enable sshd
sudo systemctl start sshd
sudo systemctl status sshd
ssh localhost
exit

This chunk installs the SSHD components, enables+starts the service and
tests a local loopback connection.

echo $USER
ip addr show | grep 192.168 | awk '{print $2}'

Grab the username and IP address of your target system to connect to in
case you don't already know this for some incomprehensible reason.

sudo systemctl status ufw.service
sudo ufw status
sudo ufw allow ssh
sudo ufw reload

Checks for a running firewall (there are others besides ufw, but again
let's not complicate things and obviously you're not going to be
manually writing out iptables rulesets when you can't even tell network
devices apart), allows SSH access and reloads.

Finally, now your target machine is setup correctly as a listening SSH
server, move to the computer you want to connect *from* - let's say your
desktop. Use the IP address and username from before:

ssh neilwin@xxxxxxxxxxxx

And now you have SSH! How you've lived without this for 18 years makes
my brain hurt slightly. Especially considering the amount of issues you
tend to run into - this would have made your life so *SO* much easier.

You also seriously need to do something about that router - getting
locked out of it is not good.

Let us know how you get on.

Cheers

-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq