Difference between revisions of "UShare"

From ArchWiki
Jump to: navigation, search
Line 1: Line 1:
[[Category:Security]]
+
[[Category:Networking]]
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
  
In a lot of circumstances it makes sense to secure data on your computer using cryptographic tools. EncFS is a userspace cryptographic filesystem, and aims to secure your data with the minimum of hassle.  It uses [http://fuse.sourceforge.com FUSE] to mount an encrypted directory onto another directory specified by the user. It does not use a loopback system like some other comparable systems such as [http://www.truecrypt.org TrueCrypt] and [http://www.saout.de/misc/dm-crypt/ DM-Crypt].
+
=Streaming Media via uShare=
 +
uShare is a UPnP program developed by [http://ushare.geexbox.org/ GeeXboX] that allows you to stream media from your computer to your Xbox 360 or Playstation 3 along with other media devices. While there are other UPnP programs out there, such as [http://fuppes.ulrich-voelkel.de/ Fuppes] and [http://mediatomb.cc/ MediaTomb] (each of which are available via AUR if you so choose), I have found after trying each of the three that uShare is the easiest to setup and works with least amount of editing and configuring.
  
This has a number of advantages, and some disadvantages compared to these systems.  Firstly it does not require any root privileges to implement, any user can create a repository of encrypted files, and use them. Secondly you do not need to create a single file and create a filesystem within that, it works on your existing filesystem, with no modifications. 
 
  
This does create a few disadvantages though, because the encrypted files are not stored in their own file, someone who obtains access to the machine can still see the underlying directory structure, the number of files, their sizes and when they were modified.  They cannot see the contents though.
+
After many hours searching for a site that explained how to setup uShare and failing, I decided that I would compile all the information I found through trial and error, along with corrections from fellow users via comments on uShare's AUR page, if for nothing else but to see my name on the ''internet''.
  
This particular method of securing your data is obviously not perfect, but it does have situations in which it is useful.
+
==Installation==
 +
To install uShare you have to grab it from [http://aur.archlinux.org/packages.php?ID=3677 AUR] as well as [http://aur.archlinux.org/packages.php?do_Details=1&ID=10200&O=&L=&C=&K=&SB=&SO=&PP=&do_Orphans=&SeB= libupnp] or if you use [http://aur.archlinux.org/packages.php?ID=5863 yaourt] you can simply run:
 +
yaourt -Sy ushare
  
To install EncFS, as root, do:
+
You will have to add a line in the PKGBUILD from:
  pacman -Sy encfs
+
  cd $startdir/src/$pkgname-$pkgver
You will need the community repository enabled to do this.
+
./configure --prefix=/usr --sysconfdir=/etc
  
To create a secured repository, type:
+
to:
  encfs ~/.crypt ~/crypt
+
  cd $startdir/src/$pkgname-$pkgver
You will be prompted whether you want to go with the default (paranoid options) or expert configuration. The latter allows you to specify algorithms and other options. The former is a fairly good default though.  You will also be prompted to set a key for encryption. Once this has been done you will have your encoded filesystem created and mounted. The encoded files are stored in ~/.crypt, and their unencrypted versions in ~/crypt.
+
sed -i -e "s%^INSTALL=\"/usr/bin/install -c\"$%INSTALL=\"$(which install) -c\"%" configure
 +
  ./configure --prefix=/usr --sysconfdir=/etc
  
To unmount the filesystem type:
+
so that it will install everything correctly.
fusermount -u ~/crypt
+
And all will be done.
+
  
When you want to remount the filesystem, you simply retype the first command, and you will be asked for the key you used to encode with, once this has been entered, then the filesystem will be mounted again.
+
*thanks goes to '''fangrahh''' for this correction
 +
 
 +
==Configuration==
 +
After the installation is complete its time to move on to the configuration of uShare.  This is very simple in the sense that you only have one file to edit, /etc/ushare.conf:
 +
 
 +
# /etc/ushare.conf
 +
# Configuration file for uShare
 +
 +
# uShare UPnP Friendly Name (default is 'uShare').
 +
USHARE_NAME=
 +
 +
# Interface to listen to (default is eth0).
 +
# Ex : USHARE_IFACE=eth1
 +
USHARE_IFACE=
 +
 +
# Port to listen to (default is random from IANA Dynamic Ports range)
 +
# Ex : USHARE_PORT=49200
 +
USHARE_PORT=
 +
 +
# Port to listen for Telnet connections
 +
# Ex : USHARE_TELNET_PORT=1337
 +
USHARE_TELNET_PORT=
 +
 +
# Directories to be shared (space or CSV list).
 +
# Ex: USHARE_DIR=/dir1,/dir2
 +
USHARE_DIR=
 +
 +
# Use to override what happens when iconv fails to parse a file name.
 +
# The default uShare behaviour is to not add the entry in the media list
 +
# This option overrides that behaviour and adds the non-iconv'ed string into
 +
# the media list, with the assumption that the renderer will be able to
 +
# handle it. Devices like Noxon 2 have no problem with strings being passed
 +
# as is. (Umlauts for all!)
 +
#
 +
# Options are TRUE/YES/1 for override and anything else for default behaviour
 +
USHARE_OVERRIDE_ICONV_ERR=
 +
 +
# Enable Web interface (yes/no)
 +
ENABLE_WEB=
 +
 +
# Enable Telnet control interface (yes/no)
 +
ENABLE_TELNET=
 +
 +
# Use XboX 360 compatibility mode (yes/no)
 +
ENABLE_XBOX=yes
 +
 +
# Use DLNA profile (yes/no)
 +
# This is needed for PlayStation3 to work (among other devices)
 +
ENABLE_DLNA=
 +
 
 +
*ex: USHARE_NAME=Archlinux
 +
**Set this to whatever you want, it is the name you will see when selecting the server
 +
 
 +
*ex: USHARE_IFACE=eth0
 +
**Default is eth0 so only change it if yours is something different
 +
 
 +
*ex: USHARE_PORT= 49200
 +
**I set this to 49200 so it was always the same port but you can leave it blank if you want it to randomly set it each time
 +
 
 +
*ex: USHARE_DIR=/media/Share
 +
**I found uShare has problems with more than one directory, so I setup a general Share directory in /media that has both my Music and Video folders but you can try multiple directories if you feel adventurous
 +
 
 +
*USHARE_OVERRIDE_ICONV_ERR=
 +
**Unless you feel like overriding the default I would leave it blank
 +
 
 +
*Web interface and Telnet service I put as no because I like to do everything from a command line but you can set this however you like
 +
 
 +
*ENABLE_XBOX=yes
 +
**'''jordz''' said that this line needs to be:
 +
USHARE_ENABLE_XBOX=yes
 +
I can confirm that this does indeed work so if you are connecting to an Xbox you should modify and enable this option
 +
 
 +
*ENABLE_DLNA=
 +
**Enable this if you are connecting to a Playstation 3 otherwise it is safe to say no here
 +
 
 +
==Troubleshooting==
 +
The only issue I've run into is running uShare as a daemon.  When in daemon mode, I have found that my Xbox complains about invalid video formats.  To fix this I have found that changing the line:
 +
[ -z "$PID" ] && /usr/bin/ushare -D $PARAMS
 +
 
 +
in /etc/rc.d/ushare to:
 +
 
 +
[ -z "$PID" ] && /usr/bin/ushare -x -D $PARAMS
 +
 
 +
works for me, but I cannot confirm that this is a general fix for all computers or that this is an issue to anyone other than myself.

Revision as of 07:27, 20 November 2008


Streaming Media via uShare

uShare is a UPnP program developed by GeeXboX that allows you to stream media from your computer to your Xbox 360 or Playstation 3 along with other media devices. While there are other UPnP programs out there, such as Fuppes and MediaTomb (each of which are available via AUR if you so choose), I have found after trying each of the three that uShare is the easiest to setup and works with least amount of editing and configuring.


After many hours searching for a site that explained how to setup uShare and failing, I decided that I would compile all the information I found through trial and error, along with corrections from fellow users via comments on uShare's AUR page, if for nothing else but to see my name on the internet.

Installation

To install uShare you have to grab it from AUR as well as libupnp or if you use yaourt you can simply run:

yaourt -Sy ushare

You will have to add a line in the PKGBUILD from:

cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr --sysconfdir=/etc

to:

cd $startdir/src/$pkgname-$pkgver
sed -i -e "s%^INSTALL=\"/usr/bin/install -c\"$%INSTALL=\"$(which install) -c\"%" configure
./configure --prefix=/usr --sysconfdir=/etc

so that it will install everything correctly.

  • thanks goes to fangrahh for this correction

Configuration

After the installation is complete its time to move on to the configuration of uShare. This is very simple in the sense that you only have one file to edit, /etc/ushare.conf:

# /etc/ushare.conf
# Configuration file for uShare

# uShare UPnP Friendly Name (default is 'uShare').
USHARE_NAME=

# Interface to listen to (default is eth0).
# Ex : USHARE_IFACE=eth1
USHARE_IFACE=

# Port to listen to (default is random from IANA Dynamic Ports range)
# Ex : USHARE_PORT=49200
USHARE_PORT=

# Port to listen for Telnet connections
# Ex : USHARE_TELNET_PORT=1337
USHARE_TELNET_PORT=

# Directories to be shared (space or CSV list).
# Ex: USHARE_DIR=/dir1,/dir2
USHARE_DIR=

# Use to override what happens when iconv fails to parse a file name.
# The default uShare behaviour is to not add the entry in the media list
# This option overrides that behaviour and adds the non-iconv'ed string into
# the media list, with the assumption that the renderer will be able to
# handle it. Devices like Noxon 2 have no problem with strings being passed
# as is. (Umlauts for all!)
# 
# Options are TRUE/YES/1 for override and anything else for default behaviour
USHARE_OVERRIDE_ICONV_ERR= 

# Enable Web interface (yes/no)
ENABLE_WEB=

# Enable Telnet control interface (yes/no)
ENABLE_TELNET=

# Use XboX 360 compatibility mode (yes/no)
ENABLE_XBOX=yes

# Use DLNA profile (yes/no)
# This is needed for PlayStation3 to work (among other devices)
ENABLE_DLNA=
  • ex: USHARE_NAME=Archlinux
    • Set this to whatever you want, it is the name you will see when selecting the server
  • ex: USHARE_IFACE=eth0
    • Default is eth0 so only change it if yours is something different
  • ex: USHARE_PORT= 49200
    • I set this to 49200 so it was always the same port but you can leave it blank if you want it to randomly set it each time
  • ex: USHARE_DIR=/media/Share
    • I found uShare has problems with more than one directory, so I setup a general Share directory in /media that has both my Music and Video folders but you can try multiple directories if you feel adventurous
  • USHARE_OVERRIDE_ICONV_ERR=
    • Unless you feel like overriding the default I would leave it blank
  • Web interface and Telnet service I put as no because I like to do everything from a command line but you can set this however you like
  • ENABLE_XBOX=yes
    • jordz said that this line needs to be:
USHARE_ENABLE_XBOX=yes

I can confirm that this does indeed work so if you are connecting to an Xbox you should modify and enable this option

  • ENABLE_DLNA=
    • Enable this if you are connecting to a Playstation 3 otherwise it is safe to say no here

Troubleshooting

The only issue I've run into is running uShare as a daemon. When in daemon mode, I have found that my Xbox complains about invalid video formats. To fix this I have found that changing the line:

[ -z "$PID" ] && /usr/bin/ushare -D $PARAMS

in /etc/rc.d/ushare to:

[ -z "$PID" ] && /usr/bin/ushare -x -D $PARAMS

works for me, but I cannot confirm that this is a general fix for all computers or that this is an issue to anyone other than myself.