Getting the login screen on hotel WiFi using Linux

Problem

I can see that I am connected to the hotel WiFi on my laptop, but the login screen does not come up on my browser. So I cannot access the Internet.

My laptop is connected to a private IP address on the hotel network, but I cannot access the login page on a browser to get access to the world wide web

I run Debian 10, using the i3 tiling manager. I use wicd as my network manager and Firefox as the browser.

My mobile phone automagically connects to the hotel WiFi and brings up the login screen. So I know that the WiFi is working and allows access to the Internet.

How do I get the WiFi login screen on my laptop?

Solution – short answers

Using iproute

Type:

ip route

Example output:

default via 192.168.96.1 dev wlp3s0 
192.168.96.0/20 dev wlp3s0 proto kernel scope link src 192.168.108.193

Look at the first line ‘default via 192.168.96.1’. Put the value 192.168.96.1, or whatever you have for that value in the first line, into your browser address bar. This should take you to the login screen.

Using /etc/resolv.conf

Look in the file /etc/resolv.conf after connecting to the WiFi and type the private IP address in this file into your browser.

To see the contents of this file, type:

more /etc/resolv.conf

Here’s the output I got. Yours will probably have a different content:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.96.1
nameserver 8.8.8.8
nameserver 8.8.4.4

When I put the private IP value (192.168.96.1 in this example) into Firefox, the login screen appeared.

Victory looks like this – the hotel login page

Hopefully, one of these methods works for you. I put an expanded explanation and the background story below. I like background stories. Makes me feel like I’m not the only one who has trouble figuring things out.

I use a VPN when accessing the world wide web. This adds a layer of security when using public networks.

Background

Our internet connection use a domain name system(DNS) server to find out where to go to get the contents for the web addresses we ask it to access. The file /etc/resolv.conf contains the IP addresses of the DNS servers in use by the current connection. This file is automatically created when you set up a new connection.

Looking at the contents of /etc/resolv.conf after I connected with the hotel WiFi, I recognise the IP addresses 8.8.8.8 and 8.8.4.4 as Google DNS addresses. This makes sense. Google will have a database of what website is where if anybody does.

The IP addresses 192.168.0.0 to 192.168.255.255 are reserved for private network addresses.

The IP address of 192.168.96.1 in the file /etc/resolv.conf is one of the addresses reserved for private networks. So this looks to be the local access point. This makes sense. The IP address for the login page is a private address on the hotel network, not accessible on the world wide web where anybody could have a go at logging in to the hotel WiFi.

Putting this IP value (192.168.96.1) into Firefox has us directed to the local login page.

I finally got to grips with this during the Covid 19 pandemic. I spent some time quarantining in a hotel in Rio de Janeiro before joining a survey ship to work offshore Brazil.

It works, then doesn’t the next time you use it

Try clearing the browser cache.

Disable any VPN you are using while connecting, then re-enable the VPN.

I hope this post is of use to others. I welcome any comments and corrections.

ssh to a pi zero w from a linux box

There are many sites and YouTube videos explaining how to connect the pi zero to a laptop or desktop using a USB cable, then access the pi zero from the laptop using ssh. Here is a link to one guide.

I followed a guide on YouTube but had a few problems connecting to the pi zero w using ssh through Linux. Each time I put in:

ssh pi@raspberrypi.local -p22

I got a blank line which then timed out and displayed:

ssh: Could not resolve hostname raspberrypi.local: Name or service not known

I successfully connected to the pi zero w using putty on a Windows 8 machine. Putty is ssh with a nice GUI interface. Windows is ‘plug and play’. I run Linux without a GUI, so have ‘plug, learn and play’ instead. Time to learn.

I fired up nm-applet, using the command:

nm-applet

Then I went to ‘Edit connections’. The pi zero w will often be the highest numbered ‘Wired connection’. In my case it was ‘Wired connection 2’. Edit this. Go to the IPv4 Settings tab. Select Link-Local Only for the method. See a screenshot showing the setup below.

Raspberry pi zero w ssh connection configuration

After saving the updated configuration, the ssh command works.

Booting a new Lenovo Thinkpad from USB stick to use Clonezilla

All I wanted to do was boot from my trusty Clonezilla USB stick to make a system back up of my shiny new Thinkpad X260. Long story short, you need to disable the ‘Secure Boot’ option in the UEFI (what used to be called BIOS) to boot from a bootable Clonezilla USB stick.

 
I bought the X260 a couple of month’s ago. This is last year’s model, so I got it at a discount. Usually I’d buy a 2/3 year old Thinkpad and replace the drive and keyboard, but found I could buy a new laptop, albeit last year’s model for about half of what it would’ve cost a year ago. A quick cleansing of the OS by installing Linux Mint. The usual kerfuffle to configure the system and remember how to partition the drive, then try to remember how to mount said partitions. Time to make an image of the OS partition. I’ve learned this is a good idea the hard way. When I tried to boot from my Clonezilla USB sticks, none of them would work! Somehow I had made a bootable USB stick that would install Linux Mint. I spent a good hour before checking on the ‘Secure Boot’ option in the UEFI screen, which by default is Enabled. Flicking this to Disabled solved this issue. 
 
Now I have an image of my OS on an external drive for when I manage to destroy the installation. Not if. When. Still, that’s how we learn, by breaking and fixing. Probably a good thing that I don’t work in medicine.

Installing linux mint 18.1 onto a Lenovo 260 with an encrypted home drive

The simplest way I found to install Linux Mint 18.1 on to my Lenovo 260 with an encrypted home drive and a separate installation partition is to install the system using the simplest options, then afterwards encrypt your home drive and shrink down the installation partition using gparted. The rest of this post is how I failed to do this several times. Which is undoubtedly due to my lack of linux wisdom.
 
I tried and failed to install Linux Mint 18.1 on to custom partitions for my root, home and swap. The system would not boot after I completed the installation. I could not install grub to the /mnt partition to fix this. I tried some stackoverflow solutions with no joy.
 
So I did a simple install, clicking on the option to encrypt the home folder. Then I used gparted on the installation USB stick to shrink down the partition. However, my swap space was also encrypted, which I understand increases security. Every time I booted I was presented with message asking for a non-existent password to mount the encrypted swap space. No real issue, I just hit enter and carried on to the regular login screen. Then I tried updating the system. For each update I had to press enter to mount the encrypted swap space. A little tedious. So I went on stack overflow, found a ‘fix’ and rendered the system unbootable. This was getting a little tedious.
 
So I again installed Linux Mint 18.1 from my USB stick. This time I chose the vanilla, easiest options, no encryption. I used the instructions here to encrypt my home drive. I used the installation stick to run gparted and shrink down the partition. So now I have Linux Mint installed on a partition and an encrypted home drive.
 
Simple. Hind sight always is.