Category Archives: Debian

Debian 8 Jessie Released

Debian 8 Jessie Released

Icon

After almost 24 months of constant development the Debian project is proud to present its new stable version 8 (code name Debian Jessie), has been released which will be supported for the next 5 years thanks to the combined work of the Debian Security team and of the Debian Long Term Support team.

Jessie ships with a new default init system, systemd. The systemd suite provides many exciting features such as faster boot times, cgroups for services, and the possibility of isolating part of the services. The sysvinit init system is still available in Jessie.

Screenshots and a screencast are available.

The Deluge Bit Torrent Client

Deluge-1

Deluge is an extremely customizable Bit Torrent Client, that has a lot of features that play very nicely with a server situation:

  • It’s modular, which means the actual daemon is entirely separate from the client which controls it. This is awesome because we can choose from several different client types: A WebGUI, which will be available to any computer on our network via the browser. An installable GUI, which is available for all three major OS’s. And a console version which can be controlled from the command line. I’ll show you how to use all three.
  • It allows us to download files to one location, and then move them to another immediately. This way we can make sure files don’t show up in the File Share or various media servers until they finish downloading.
  • It will allow us to dynamically change the bandwidth provided to torrents depending on the time of day, so we don’t slow down the whole network during peak hours.
  • It can accept proxies, so we can use the wonderful BTGuard proxy, which anatomizes our downloading (Though I certainly would never advise you to do anything illegal. Please check the laws for your state and country before you download anything.)
  • It accepts plug-ins, which means we can add any additional functionality we may find lacking.

Installing Deluge Headless

At the time of writing, Deluge 1.3.x was the release available in the Ubuntu repositories. If a newer version has been released, these instructions may or may not still work.

Before downloading deluge, we need to create a user to run it as:

sudo adduser --disabled-password --system --home /home/deluge --group deluge

Then we can go ahead and download the Deluge:

sudo apt-get update && sudo apt-get install deluged deluge-webui

Configuring the Daemon to run at boot

To start deluge and the webui at boot, we need to have an init.d script set-up to start it during the boot process. Luckily for us, someone else has already written an init.d script, all we need to do is configure it, and copy it into our init.d directory. The first thing we need to do is create the /etc/default/deluge-daemon file. this is what passes the configuration to the OS.

sudo nano /etc/default/deluge-daemon

Inside it, we’ll paste the following:

# Configuration for /etc/init.d/deluge-daemon
# The init.d script will only run if this variable non-empty.
DELUGED_USER="deluge"
# Should we run at startup?
RUN_AT_STARTUP="YES"

Save off the file (Ctrl+X, then Y), and create the actual init.d script:

sudo nano /etc/init.d/deluge-daemon

Paste into it this init script, copied from here, and originally hosted here.

Now we need to make it executable, and update the boot process to reflect that we added it:

sudo chmod a+x /etc/init.d/deluge-daemon && sudo update-rc.d deluge-daemon defaults

From here, you should be able to reboot the server, and access the web interface from [hostnameofMediaServer]:8112. It will look like this:

Deluge Log-in Screen

The default password is “deluge”, though the WebUI will ask you to change it as soon as you log in.

Using an Installable Client

My favorite way to control deluge is from a client installed on my computer. This is because the WebGUI has only basic functionality, as it’s still in development. To control any plugins, such as the scheduler, the automatic torrent adder, etc., we need the full client. It’s also easier to navigate the settings page with scroll bars available, and you can associate .torrent files with the client, so you can just click on torrent files to open them on the server. That being said, it takes a few steps to get this “Thin Client” set-up working correctly.

Configuring the server for use with the Thin Client

First we need to download the console version of deluge so that we can configure a few settings:

sudo apt-get install deluge-console

Once it has finished installing go ahead and boot up deluge-console by typing:

sudo -H -u deluge deluge-console

in the console, allow remote connections to the daemon:

config -s allow_remote True

and exit:

exit

now we need to go ahead and shutdown the daemon

sudo /etc/init.d/deluge-daemon stop

and add a username and password for the daemon to the auth file:

sudo chmod -R 777 /home/deluge && sudo -H -u deluge echo username:password:10 >> /home/deluge/.config/deluge/auth

now we can go ahead and start the daemon back up:

sudo /etc/init.d/deluge-daemon start

Installing the Client

  • To install the client in Ubuntu, simply run sudo apt-get install deluge-gtk
  • To install the client in Arch Linux, simply run sudo pacman -Sy deluge
  • To install the client In Windows or Mac, just grab the installer from here.

Configuring the Client

Open the client and navigate to the interface tab in settings [Edit → Preferences → Interface]. Uncheck Enabled under Classic Mode. Go ahead and [File → Exit] When you start the client back up, you’ll see a screen that looks like this:

Deluge Connection Manager

Click Add and fill in the hostname of your media server, and the username and password you put in the auth file earlier. It should look like this:

Add Server

Once you add the server, you should be able to click connect, and log-in to the server. Now you can treat the deluge client as if it were hosted on your computer.

Deluge is an extremely customizable Bit Torrent Client, that has a lot of features that play very nicely with our server situation:

  • It’s modular, which means the actual daemon is entirely separate from the client which controls it. This is awesome because we can choose from several different client types: A WebGUI, which will be available to any computer on our network via the browser. An installable GUI, which is available for all three major OS’s. And a console version which can be controlled from the command line. I’ll show you how to use all three.
  • It allows us to download files to one location, and then move them to another immediately. This way we can make sure files don’t show up in the File Share or various media servers until they finish downloading.
  • It will allow us to dynamically change the bandwidth provided to torrents depending on the time of day, so we don’t slow down the whole network during peak hours.
  • It can accept proxies, so we can use the wonderful BTGuard proxy, which anatomizes our downloading (Though I certainly would never advise you to do anything illegal. Please check the laws for your state and country before you download anything.)
  • It accepts plug-ins, which means we can add any additional functionality we may find lacking.

Installing Deluge Headless

At the time of writing, Deluge 1.3.x was the release available in the Ubuntu repositories. If a newer version has been released, these instructions may or may not still work.

Before downloading deluge, we need to create a user to run it as:

sudo adduser --disabled-password --system --home /home/deluge --group deluge

Then we can go ahead and download the Deluge:

sudo apt-get update && sudo apt-get install deluged deluge-webui

Configuring the Daemon to run at boot

To start deluge and the webui at boot, we need to have an init.d script set-up to start it during the boot process. Luckily for us, someone else has already written an init.d script, all we need to do is configure it, and copy it into our init.d directory. The first thing we need to do is create the /etc/default/deluge-daemon file. this is what passes the configuration to the OS.

sudo nano /etc/default/deluge-daemon

Inside it, we’ll paste the following:

# Configuration for /etc/init.d/deluge-daemon
# The init.d script will only run if this variable non-empty.
DELUGED_USER="deluge"
# Should we run at startup?
RUN_AT_STARTUP="YES"

Save off the file (Ctrl+X, then Y), and create the actual init.d script:

sudo nano /etc/init.d/deluge-daemon

Paste into it this init script, copied from here, and originally hosted here.

Now we need to make it executable, and update the boot process to reflect that we added it:

sudo chmod a+x /etc/init.d/deluge-daemon && sudo update-rc.d deluge-daemon defaults

From here, you should be able to reboot the server, and access the web interface from [hostnameofMediaServer]:8112. It will look like this:

Deluge Log-in Screen

The default password is “deluge”, though the WebUI will ask you to change it as soon as you log in.

Using an Installable Client

My favorite way to control deluge is from a client installed on my computer. This is because the WebGUI has only basic functionality, as it’s still in development. To control any plugins, such as the scheduler, the automatic torrent adder, etc., we need the full client. It’s also easier to navigate the settings page with scroll bars available, and you can associate .torrent files with the client, so you can just click on torrent files to open them on the server. That being said, it takes a few steps to get this “Thin Client” set-up working correctly.

Configuring the server for use with the Thin Client

First we need to download the console version of deluge so that we can configure a few settings:

sudo apt-get install deluge-console

Once it has finished installing go ahead and boot up deluge-console by typing:

sudo -H -u deluge deluge-console

in the console, allow remote connections to the daemon:

config -s allow_remote True

and exit:

exit

now we need to go ahead and shutdown the daemon

sudo /etc/init.d/deluge-daemon stop

and add a username and password for the daemon to the auth file:

sudo chmod -R 777 /home/deluge && sudo -H -u deluge echo username:password:10 >> /home/deluge/.config/deluge/auth

now we can go ahead and start the daemon back up:

sudo /etc/init.d/deluge-daemon start

Installing the Client

  • To install the client in Ubuntu, simply run sudo apt-get install deluge-gtk
  • To install the client in Arch Linux, simply run sudo pacman -Sy deluge
  • To install the client In Windows or Mac, just grab the installer from here.

Configuring the Client

Open the client and navigate to the interface tab in settings [Edit → Preferences → Interface]. Uncheck Enabled under Classic Mode. Go ahead and [File → Exit] When you start the client back up, you’ll see a screen that looks like this:

Deluge Connection Manager

Click Add and fill in the hostname of your media server, and the username and password you put in the auth file earlier. It should look like this:

Add Server

Once you add the server, you should be able to click connect, and log-in to the server. Now you can treat the deluge client as if it were hosted on your computer.

Sharing Files with Windows using Samba

 samba

Unfortunately, Windows can’t connect to NFS, so we have to set up a Samba server. Samba is an open-source implementation of the SMB (Server Message Block) protocol that’s the standard method of file sharing for Windows computers. It allows us to share our unix files and printers to a networked windows computer. It’s actually really simple to set up, as there are not too terribly many options for a windows network.

Installing Samba

We install Samba with apt-get as we have almost everything else so far:

sudo apt-get update && sudo apt-get install dbus samba

once it installs, we can access samba from Webmin. You may have to “Refresh Modules” to get it to show up, but it will be in [Servers → Samba Windows File Sharing]. It should look like this:

Samba

Creating Users

Before we can create a File Share, we need to create a couple users to access it, since I doubt you want to give your personal password to anyone wishing to access the file share. We’ll go ahead and do this from the command line as it’s quicker. If you’re only creating the user for use with Samba, then you can just:

sudo useradd -g users -G lp [nameofnewuser] -M

the -M tells useradd not to create a home directory for the user. So if you’re planning on sharing /home so that each user has a separate share, obviously you should leave this off. Note that you don’t need to give this user a system password, since they won’t be logging on the server. We will just give them a samba password later.

If you want your user to have no administrative rights, but otherwise be able to log in to the server normally, run this command:

sudo useradd -g users -G audio,floppy,lp,games -s /bin/bash [nameofnewuser]

and then give them a password by running:

passwd [nameofnewuser]

to give the new user full administrative privileges run:

useradd -m -g users -G audio,lp,video,wheel,games,power -s /bin/bash [nameofnewuser]

and then give them a password as above.

Converting our UNIX Users to Samba Users

From the Samba Page in Webmin (Servers → Samba Windows File Sharing), click on the convert UNIX Users to Samba Users Button. The default settings are fine, so go ahead and click “convert.” It may take a minute to process your users, then you can click “return to shares.”

Now we need to give our new Samba Users passwords. Click on Edit Samba users and passwords. Here you must click on the name of each user you wish to give samba access, select “New Password” and type their password in the field.

At this point our Users are all set up, so we can start creating our samba shares.

Creating a Samba Share

To create a new file share we can go ahead and hit Create a new file share underneath the list of your serves on the Samba Page in Webmin. It will take you to a page that looks like this:

Create a New File Share

From here you can enter your settings:

  • Share Name: This is the name that will appear on the share in your workgroup, so choose something that makes sense: “Media Share” or “Document Share” or something similar.
  • Directory to Share: if you click the “…” button you can browse to the folder you would like to make available.
  • Create with owner: Change this to your username.
  • Create with group: change this to “users”.
  • Share Comment: this is the description that will appear on the file share.

Once you’re done you can hit “Create.” when you get back to the samba screen, click on the name of the Share you just created so we can change a couple settings. In Security and Access Control change Writeable to “yes.” In File Permissions, Change New Unix File Mode to 775 and New Unix Folder Mode to 775. This will make it so that any files or folders created through samba are editable by anyone in the group of the file’s creator, which should be users. When you’re finished, go ahead and return to the main Samba Page and click on Restart Samba Servers to apply the changes.

That’s it. from “Network” in your “My Computer” You should be able to see your Samba Shares and Log-in to them with the credentials we created earlier.