Categories
Fixes

Xubuntu Default File Manager for Qt Applications

I’ve had to use this fix a few times, but I forget exactly what it is and waste too much time searching the web when I need it again, so I’m documenting it here.

Qbittorrent has a setting where you can double-click an item in the transfer list to open the destination folder. This is helpful if you want to instantly navigate to the folder where you downloaded the Linux ISO to.

But it fails on Xubuntu which uses XFCE instead of Gnome as its desktop environment. It can be fixed with one command in the CLI. It also helps other Qt applications play nice with the Thunar file manager.

  • Run to see current setting:
    xdg-mime query default inode/directory
  • Result:
    org.gnome.Nautilus.desktop (not correct)
  • Run to change setting:
    xdg-mime default thunar.desktop inode/directory
  • Run to see new setting:
    xdg-mime query default inode/directory
  • Result:
    thunar.desktop (correct)

Solution from: https://askubuntu.com/questions/253131/how-to-set-thunar-as-a-default-file-manager

Older versions had “Thunar” capitalized, but for a freshly installed Xubuntu 22.04 it was lowercase.

Categories
Fixes

Connect to Windows RDP over SSH

It’s much safer to expose a Linux computer to the Internet than a Windows desktop computer. But I have a primary Windows computer at home that I like to access even when I’m not home. For example, to login to online banking or send a file.

Before I was proficient at Linux system administration, I opened a random port number (security through obfuscation) on my router and redirected it to the standard port number 3389 for Windows Remote Desktop (RDP), so I could use remote desktop from my phone or laptop to use my home computer. This was a problem, and a poor security choice. I am now able to connect to Windows computers on my home network with only one port open for SSH to one single Linux computer on my home network.

Once I started using SSH to tunnel to my Linux computers to connect to them with VNC, I realized the tunnel could go from the Linux computer to another computer on the LAN. Side note: I have VNC configured to only allow connections from localhost, so no one on my LAN can connect to the Linux computers unless they’re using SSH.

To connect to my Linux computer, I have port 54321 forwarding to the standard port 22 for SSH. This allows me to control the computer over SSH or use a tunnel for VNC. My tunnel is configured to direct traffic going to port 5900 on my device to go to port 5900 on the Linux computer.

At some point I realized I was specifying localhost as the destination of the tunnel, so maybe that meant I could put a different computer’s hostname there and connect to it. I’m still going through that same Linux computer, but directly the traffic to a different computer on the LAN.

When I’m away from home and on my Windows laptop, I use KiTTY to make my SSH connections. The Host Name I’m connecting to is the domain name I’ve registered for this purpose, serving files using mysecureshell, and hosting a web server at home. Let’s call it example.com for now. I configured up the No-IP service in my router’s settings to make sure that domain name always points at my home network.

The port number is the same as if I wanted to use SSH (and VNC) for the Linux computer: example.com:54321. Then I set up the tunnel with the source port as port 3388 and the destination hostname of windowscomputer.lan with the destination port as port 3389.

After connecitng to the Linux computer with KiTTy, I connect to localhost:3388 with the Windows RPD client to access the tunnel to the Windows computer on my home network.

You can’t use 3389 as the source port because when you use the Windows RPD client and connect to localhost:3389 it thinks you’re connecting to the computer you’re in front of. To get around that, set the Windows RDP client to connect to localhost:3388 instead (or whichever port number you’ve set when you create the tunnel).