Showing posts with label ufw. Show all posts
Showing posts with label ufw. Show all posts

Wednesday, 17 December 2014

Setting Up Yatse Remote Control for XBMC

My recent project to repair and consolidate my music library seems to have taken on a life of its own!

You may recall that back in September, my NAS failed leaving me with a spare 1TB hdd. Having fixed my music library, I decided to back-up my DVD library and build an HTPC around the redundant drive: it's taken months and I'm nowhere near finishing! Last night, the DELL Dimension, the DELL Inspiron, & the Compaq CQ60 were all backing-up movie files.

Designing a PC to fit around the drive has been fun, and I think that I can build a first-class rig for around £300 but money is a real issue at the moment and I've had to make compromises. One consideration is how to control the rig from my sofa: originally, I'd planned to use my Logitech K400r wireless keyboard (from my file server), saving myself a few quid on an IR remote control. However, on yesterday's RSS feed, Maximum PC did a piece on getting started with XBMC and I came across a reference to a smartphone app called Yatse XBMC also offers an official remote, which under test, is just as good but a little more difficult to set up.

Downloading and installing Yatse on your Android phone or tablet is simple (just head over to the Google Play Store & search for xbmc remote or Yatse), the basic app is free. However, getting the app to play nice with XBMC can be a little tricky! When you open the Yatse app, you should be prompted to add a server (called Host in Yatse). The nice thing with this app, is that the wizard does quite a lot of the work for you - you should only need to select the Host, add a username and a password (if you've enabled them in Kodi/XBMC. However, the setup may fail if you're running a firewall on your Linux box.

If you are running a firewall (and you should be!), you'll need to open a couple of ports for Yatse or XBMC Remote to work properly. Open a terminal and do:

sudo ufw allow proto tcp from 192.168.1.0/24 to any port 8080

Followed by:

sudo ufw allow proto udp from 192.168.1.0/24 to any port 9777

You may need to change the ip range to suit your router and, depending on your version of Kodi/XMBC, your tcp port. Unless you've done something very unusual on your system, the udp port should be left at the default value of 9777. In Kodi Gotham, you can check your tcp port under System > Settings > Services > Webserver, but I suspect that it will be a similar route in earlier versions.

Sources & References:

Saturday, 10 May 2014

ufw - Letting Samba Play

In yesterday's post on security I mentioned that, if you share files on your network using Samba, you'll have to add some special rules to your firewall. Fear not, this is pretty easy!

Open a terminal and type the following commands pressing enter after each one.

sudo ufw allow proto udp from 192.168.1.0/24 to any port 137

sudo ufw allow proto udp from 192.168.1.0/24 to any port 138

sudo ufw allow proto tcp from 192.168.1.0/24 to any port 139

sudo ufw allow proto tcp from 192.168.1.0/24 to any port 445

You may not have the same address as the one used in the example code above - you can check your own ip address in your terminal (in Linux) using:

ifconfig -a

Find your (live) network connection from the list and identify the inet addr data and amend the above rules accordingly. As you add each new rule, the terminal will confirm that it has been added successfully. However, you can check the status of your firewall once all of the rules have been added with:

sudo ufw status

If all's gone well, you should see something like the screen below:

Remember, to access folders and files you'll need a Samba password on the server (you'll be prompted for your username & password when you try to access the files through your file manager). You can add a user and password from the terminal:

sudo smbpasswd -a [username]

Change [username] to suit your circumstances. You'll be prompted for you root password (if you're not already operating at elevated permissions) and then for a SMB password - this is the password that you'll use to access files from a client computer. Confirm your SMB password when prompted.

Reboot and you should be able to access files from a remote client. Remember, you will have to open these ports on any pc with ufw enabled if you want to share folders and files using Samba.

Sources & References: